diff --git a/src/DataExchange/TKDESTEP/GTests/StepTidy_BaseTestFixture.pxx b/src/DataExchange/TKDESTEP/GTests/StepTidy_BaseTestFixture.pxx index e8c8f0821a..b5846c4ae7 100644 --- a/src/DataExchange/TKDESTEP/GTests/StepTidy_BaseTestFixture.pxx +++ b/src/DataExchange/TKDESTEP/GTests/StepTidy_BaseTestFixture.pxx @@ -32,7 +32,6 @@ class StepTidy_BaseTestFixture : public testing::Test protected: // Initialize the work session and model. StepTidy_BaseTestFixture() - : myWS() { STEPControl_Controller::Init(); myWS = new XSControl_WorkSession; diff --git a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.pxx b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.pxx index 732da89ae3..27472ee9ae 100644 --- a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.pxx +++ b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedGeometricSet.pxx @@ -30,7 +30,7 @@ public: DEFINE_STANDARD_ALLOC //! Empty constructor - RWStepVisual_RWRepositionedTessellatedGeometricSet() {}; + RWStepVisual_RWRepositionedTessellatedGeometricSet() = default; //! Reads RepositionedTessellatedGeometricSet Standard_HIDDEN void ReadStep( diff --git a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.pxx b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.pxx index 12f5c5f015..de75058308 100644 --- a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.pxx +++ b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWRepositionedTessellatedItem.pxx @@ -30,7 +30,7 @@ public: DEFINE_STANDARD_ALLOC //! Empty constructor - RWStepVisual_RWRepositionedTessellatedItem() {}; + RWStepVisual_RWRepositionedTessellatedItem() = default; //! Reads RepositionedTessellatedItem Standard_HIDDEN void ReadStep( diff --git a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx index 82fbc5a462..d46a032a7c 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx @@ -265,7 +265,7 @@ BVH_Tree* BVH_Tree::CollapseToQuadTree for (int aNodeIdx = 0; aNodeIdx < aGrandChildNodes.Length(); ++aNodeIdx) { - aQueue.push_back(std::make_pair(aGrandChildNodes(aNodeIdx), std::get<1>(aNode) + 1)); + aQueue.emplace_back(aGrandChildNodes(aNodeIdx), std::get<1>(aNode) + 1); } aNodeInfo = BVH_Vec4i(0 /* inner flag */, diff --git a/src/FoundationClasses/TKernel/FlexLexer/FlexLexer.h b/src/FoundationClasses/TKernel/FlexLexer/FlexLexer.h index dbd2d5298e..59c8df6140 100644 --- a/src/FoundationClasses/TKernel/FlexLexer/FlexLexer.h +++ b/src/FoundationClasses/TKernel/FlexLexer/FlexLexer.h @@ -59,7 +59,7 @@ extern "C++" class FlexLexer { public: - virtual ~FlexLexer() {} + virtual ~FlexLexer() = default; const char* YYText() const { return yytext; } @@ -191,7 +191,7 @@ extern "C++" size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ yy_buffer_state** yy_buffer_stack; /**< Stack as an array. */ - void yyensure_buffer_stack(void); + void yyensure_buffer_stack(); // The following are not always needed, but may be depending // on use of certain flex features (like REJECT or yymore()). diff --git a/src/FoundationClasses/TKernel/GTests/NCollection_OrderedDataMap_Test.cxx b/src/FoundationClasses/TKernel/GTests/NCollection_OrderedDataMap_Test.cxx index bf311df4ea..4bed3b1812 100644 --- a/src/FoundationClasses/TKernel/GTests/NCollection_OrderedDataMap_Test.cxx +++ b/src/FoundationClasses/TKernel/GTests/NCollection_OrderedDataMap_Test.cxx @@ -585,7 +585,7 @@ TEST_F(NCollection_OrderedDataMapTest, ItemsStructuredBindings) for (auto [aKey, aValue] : aMap.Items()) { aKeys.push_back(aKey); - aValues.push_back(aValue.ToCString()); + aValues.emplace_back(aValue.ToCString()); } const std::vector anExpectedKeys = {30, 10, 20}; diff --git a/src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.cxx b/src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.cxx index 3f7ff5264a..2308a99a8f 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.cxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.cxx @@ -105,7 +105,7 @@ Standard_ErrorHandler* Standard_ErrorHandler::FindHandler() #if defined(OCC_CONVERT_SIGNALS) -Standard_ErrorHandler::Callback::Callback() {} +Standard_ErrorHandler::Callback::Callback() = default; Standard_ErrorHandler::Callback::~Callback() { diff --git a/src/FoundationClasses/TKernel/Standard/Standard_ReadLineBuffer.hxx b/src/FoundationClasses/TKernel/Standard/Standard_ReadLineBuffer.hxx index 7e68dbb56c..fecc9a7c03 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_ReadLineBuffer.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_ReadLineBuffer.hxx @@ -208,7 +208,7 @@ public: } else { - if (myReadBufferLastStr.size() > 0) + if (!myReadBufferLastStr.empty()) { myReadBufferLastStr.clear(); } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx index 202894ee64..e66f0efb9f 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx @@ -1079,7 +1079,7 @@ public: double aD2 = aP1.SquareDistance(aP2); if (aD2 < aTolSum2) { - myPairs.push_back(PairIDs(anID1, anID2)); + myPairs.emplace_back(anID1, anID2); return true; } } diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.cxx index a5979ffcd0..17c5c495a4 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.cxx @@ -47,15 +47,7 @@ BOPTools_Set::BOPTools_Set(const occ::handle& theAllo //================================================================================================= -BOPTools_Set::BOPTools_Set(const BOPTools_Set& theOther) - : myAllocator(theOther.myAllocator), - myShapes(theOther.myShapes), - myShape(theOther.myShape), - myNbShapes(theOther.myNbShapes), - mySum(theOther.mySum), - myUpper(theOther.myUpper) -{ -} +BOPTools_Set::BOPTools_Set(const BOPTools_Set& theOther) = default; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx index 02a88c9e65..d2f83f48a4 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx @@ -415,7 +415,7 @@ public: break; case ProfileCmd::X: // Translate along X - if (op.params.size() >= 1) + if (!op.params.empty()) { // If first point not set, implicitly start at (0,0) if (!aFirstSet) @@ -436,7 +436,7 @@ public: break; case ProfileCmd::Y: // Translate along Y - if (op.params.size() >= 1) + if (!op.params.empty()) { // If first point not set, implicitly start at (0,0) if (!aFirstSet) @@ -565,9 +565,9 @@ public: { std::vector aPoints; aPoints.push_back(theCorner); - aPoints.push_back(gp_Pnt(theCorner.X() + theX, theCorner.Y(), theCorner.Z())); - aPoints.push_back(gp_Pnt(theCorner.X() + theX, theCorner.Y() + theY, theCorner.Z())); - aPoints.push_back(gp_Pnt(theCorner.X(), theCorner.Y() + theY, theCorner.Z())); + aPoints.emplace_back(theCorner.X() + theX, theCorner.Y(), theCorner.Z()); + aPoints.emplace_back(theCorner.X() + theX, theCorner.Y() + theY, theCorner.Z()); + aPoints.emplace_back(theCorner.X(), theCorner.Y() + theY, theCorner.Z()); return CreatePolygonWire(aPoints, true); } diff --git a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx index af5529acc0..33f7754233 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx @@ -912,14 +912,14 @@ TEST_F(BCutSimpleTest, ComplexPolygonPrismMinusBox_H1) // Create custom polygon from H1 test vertices: v1(0,0,0) v2(1,0,0) v3(1,3,0) v4(2,3,0) v5(2,0,0) // v6(3,0,0) v7(3,5,0) v8(0,5,0) std::vector aPoints; - aPoints.push_back(gp_Pnt(0, 0, 0)); // v1 - aPoints.push_back(gp_Pnt(1, 0, 0)); // v2 - aPoints.push_back(gp_Pnt(1, 3, 0)); // v3 - aPoints.push_back(gp_Pnt(2, 3, 0)); // v4 - aPoints.push_back(gp_Pnt(2, 0, 0)); // v5 - aPoints.push_back(gp_Pnt(3, 0, 0)); // v6 - aPoints.push_back(gp_Pnt(3, 5, 0)); // v7 - aPoints.push_back(gp_Pnt(0, 5, 0)); // v8 + aPoints.emplace_back(0, 0, 0); // v1 + aPoints.emplace_back(1, 0, 0); // v2 + aPoints.emplace_back(1, 3, 0); // v3 + aPoints.emplace_back(2, 3, 0); // v4 + aPoints.emplace_back(2, 0, 0); // v5 + aPoints.emplace_back(3, 0, 0); // v6 + aPoints.emplace_back(3, 5, 0); // v7 + aPoints.emplace_back(0, 5, 0); // v8 // Create wire and extrude to solid (prism sol p 0 0 2) TopoDS_Wire aWire = BOPTest_Utilities::CreatePolygonWire(aPoints, true); @@ -941,14 +941,14 @@ TEST_F(BCutSimpleTest, ComplexPolygonPrismMinusBox_H2) // Create custom polygon from H2 test vertices (same as H1): v1(0,0,0) v2(1,0,0) v3(1,3,0) // v4(2,3,0) v5(2,0,0) v6(3,0,0) v7(3,5,0) v8(0,5,0) std::vector aPoints; - aPoints.push_back(gp_Pnt(0, 0, 0)); // v1 - aPoints.push_back(gp_Pnt(1, 0, 0)); // v2 - aPoints.push_back(gp_Pnt(1, 3, 0)); // v3 - aPoints.push_back(gp_Pnt(2, 3, 0)); // v4 - aPoints.push_back(gp_Pnt(2, 0, 0)); // v5 - aPoints.push_back(gp_Pnt(3, 0, 0)); // v6 - aPoints.push_back(gp_Pnt(3, 5, 0)); // v7 - aPoints.push_back(gp_Pnt(0, 5, 0)); // v8 + aPoints.emplace_back(0, 0, 0); // v1 + aPoints.emplace_back(1, 0, 0); // v2 + aPoints.emplace_back(1, 3, 0); // v3 + aPoints.emplace_back(2, 3, 0); // v4 + aPoints.emplace_back(2, 0, 0); // v5 + aPoints.emplace_back(3, 0, 0); // v6 + aPoints.emplace_back(3, 5, 0); // v7 + aPoints.emplace_back(0, 5, 0); // v8 // Create wire and extrude to solid (prism sol p 0 0 2) TopoDS_Wire aWire = BOPTest_Utilities::CreatePolygonWire(aPoints, true); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Gordon.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Gordon.cxx index d020e64d7d..c3e32ee983 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Gordon.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Gordon.cxx @@ -432,7 +432,7 @@ bool reparamCurve(occ::handle& theCurve, //================================================================================================= -GeomFill_Gordon::GeomFill_Gordon() {} +GeomFill_Gordon::GeomFill_Gordon() = default; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GordonBuilder.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GordonBuilder.cxx index 48219439db..c843e029e7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GordonBuilder.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GordonBuilder.cxx @@ -25,7 +25,7 @@ //================================================================================================= -GeomFill_GordonBuilder::GeomFill_GordonBuilder() {} +GeomFill_GordonBuilder::GeomFill_GordonBuilder() = default; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx index b5684290df..416af22892 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_DistBetweenPCurvesGen.gxx @@ -39,14 +39,14 @@ IntCurve_DistBetweenPCurvesGen::IntCurve_DistBetweenPCurvesGen(const TheCurve& C //================================================================================================= -int IntCurve_DistBetweenPCurvesGen::NbVariables(void) const +int IntCurve_DistBetweenPCurvesGen::NbVariables() const { return (2); } //================================================================================================= -int IntCurve_DistBetweenPCurvesGen::NbEquations(void) const +int IntCurve_DistBetweenPCurvesGen::NbEquations() const { return (2); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ExactIntersectionPoint.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ExactIntersectionPoint.gxx index f932bf5853..258b8617e3 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ExactIntersectionPoint.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ExactIntersectionPoint.gxx @@ -238,7 +238,7 @@ void IntCurve_ExactIntersectionPoint::Roots(double& U, double& V) //================================================================================================= -void IntCurve_ExactIntersectionPoint::MathPerform(void) +void IntCurve_ExactIntersectionPoint::MathPerform() { math_FunctionSetRoot Fct(FctDist, ToleranceVector, 60); Fct.Perform(FctDist, StartingPoint, BInfVector, BSupVector); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx index c383842c26..11f8385853 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx @@ -337,7 +337,7 @@ void IntCurve_Polygon2dGen::Dump(void) const } } #else -void IntCurve_Polygon2dGen::Dump(void) const +void IntCurve_Polygon2dGen::Dump() const { static int debug = 0; if (debug) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx index 6745e2eea2..bdf6f77130 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx @@ -162,7 +162,7 @@ public: { if (!myBVHSet1->Box(theID1).IsOut(myBVHSet2->Box(theID2))) { - myPairs.push_back(PairIDs(myBVHSet1->Element(theID1), myBVHSet2->Element(theID2))); + myPairs.emplace_back(myBVHSet1->Element(theID1), myBVHSet2->Element(theID2)); return true; } return false; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx index 99735f25b3..bffe63607f 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx @@ -258,7 +258,7 @@ bool BRepExtrema_ProximityValueTool::getEdgeAdditionalVertices( double aPar = aGCPnts.Parameter(aVertIdx); gp_Pnt aP = aBAC.Value(aPar); - theAddVertices.push_back(BVH_Vec3d(aP.X(), aP.Y(), aP.Z())); + theAddVertices.emplace_back(aP.X(), aP.Y(), aP.Z()); theAddStatuses.Append(ProxPnt_Status::ProxPnt_Status_MIDDLE); } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.cxx index 9f8e5f8223..b6ccbd1c4d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.cxx @@ -250,7 +250,7 @@ BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::PreCheckEl if ((aTrng0Vtxs[aVertIdx1] - aTrng1Vtxs[aVertIdx2]).SquareModulus() < Precision::SquareConfusion()) { - aSharedVtxs.push_back(std::pair(aVertIdx1, aVertIdx2)); + aSharedVtxs.emplace_back(aVertIdx1, aVertIdx2); break; // go to next vertex of the 1st triangle } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx index e33bd31ecb..fde535141d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx @@ -268,8 +268,10 @@ bool BRepExtrema_TriangleSet::initFace(const TopoDS_Face& theFace, const int the aTriangulation->Triangle(aTriIdx).Get(aVertex1, aVertex2, aVertex3); - myTriangles.push_back( - BVH_Vec4i(aVertex1 + aVertOffset, aVertex2 + aVertOffset, aVertex3 + aVertOffset, theIndex)); + myTriangles.emplace_back(aVertex1 + aVertOffset, + aVertex2 + aVertOffset, + aVertex3 + aVertOffset, + theIndex); } myNumTrgInShapeVec.SetValue(theIndex, aTriangulation->NbTriangles()); @@ -296,10 +298,10 @@ bool BRepExtrema_TriangleSet::initEdge(const TopoDS_Edge& theEdge, const int the for (int aVertIdx = 1; aVertIdx < aPolygon->NbNodes(); ++aVertIdx) { // segment as degenerate triangle - myTriangles.push_back(BVH_Vec4i(aVertIdx + aVertOffset, - aVertIdx + aVertOffset + 1, - aVertIdx + aVertOffset + 1, - theIndex)); + myTriangles.emplace_back(aVertIdx + aVertOffset, + aVertIdx + aVertOffset + 1, + aVertIdx + aVertOffset + 1, + theIndex); } return true; } @@ -316,7 +318,7 @@ void BRepExtrema_TriangleSet::initNodes(const NCollection_Array1& theNod aVertex.Transform(theTrsf); - myVertexArray.push_back(BVH_Vec3d(aVertex.X(), aVertex.Y(), aVertex.Z())); + myVertexArray.emplace_back(aVertex.X(), aVertex.Y(), aVertex.Z()); myShapeIdxOfVtxVec.Append(theIndex); } diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_VersionStamp.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_VersionStamp.hxx index 4e9e71389b..963e450f58 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_VersionStamp.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_VersionStamp.hxx @@ -53,9 +53,7 @@ struct BRepGraph_VersionStamp //! Default constructor. Creates an invalid stamp (invalid UID, zero counters). BRepGraph_VersionStamp() - : myUID(), - myRefUID(), - myMutationGen(0), + : myMutationGen(0), myGeneration(0), myDomain(Domain::None) { @@ -69,7 +67,6 @@ struct BRepGraph_VersionStamp const uint32_t theMutationGen, const uint32_t theGeneration) : myUID(theUID), - myRefUID(), myMutationGen(theMutationGen), myGeneration(theGeneration), myDomain(Domain::Entity) @@ -83,8 +80,7 @@ struct BRepGraph_VersionStamp BRepGraph_VersionStamp(const BRepGraph_RefUID& theRefUID, const uint32_t theMutationGen, const uint32_t theGeneration) - : myUID(), - myRefUID(theRefUID), + : myRefUID(theRefUID), myMutationGen(theMutationGen), myGeneration(theGeneration), myDomain(Domain::Ref) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx index 1a38fe43ec..57f62f6b5a 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx @@ -113,7 +113,7 @@ public: //! Returns material index of triangle set. int MaterialIndex() const { - if (Elements.size() == 0) + if (Elements.empty()) { return INVALID_MATERIAL; } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx index 3038ee36bd..2a3f7bf60f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx @@ -642,10 +642,9 @@ occ::handle OpenGl_View::addRaytracePrimitiveArray( { const float* aCoords = reinterpret_cast(aPosData + anAttribStride * aVertIter); - aSet->Vertices.push_back( - BVH_Vec3f(aCoords[0], - aCoords[1], - anAttrib.DataType != Graphic3d_TOD_VEC2 ? aCoords[2] : 0.0f)); + aSet->Vertices.emplace_back(aCoords[0], + aCoords[1], + anAttrib.DataType != Graphic3d_TOD_VEC2 ? aCoords[2] : 0.0f); } } } @@ -680,7 +679,7 @@ occ::handle OpenGl_View::addRaytracePrimitiveArray( { for (int aVertIter = 0; aVertIter < anAttribs->NbElements; ++aVertIter) { - aSet->Normals.push_back(BVH_Vec3f()); + aSet->Normals.emplace_back(); } } @@ -688,7 +687,7 @@ occ::handle OpenGl_View::addRaytracePrimitiveArray( { for (int aVertIter = 0; aVertIter < anAttribs->NbElements; ++aVertIter) { - aSet->TexCrds.push_back(BVH_Vec2f()); + aSet->TexCrds.emplace_back(); } } @@ -807,17 +806,17 @@ bool OpenGl_View::addRaytraceTriangleArray(OpenGl_TriangleSet& { for (int aVert = theOffset; aVert < theOffset + theCount - 2; aVert += 3) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + 0), - theIndices->Index(aVert + 1), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(aVert + 0), + theIndices->Index(aVert + 1), + theIndices->Index(aVert + 2), + theMatID); } } else { for (int aVert = theOffset; aVert < theOffset + theCount - 2; aVert += 3) { - theSet.Elements.push_back(BVH_Vec4i(aVert + 0, aVert + 1, aVert + 2, theMatID)); + theSet.Elements.emplace_back(aVert + 0, aVert + 1, aVert + 2, theMatID); } } @@ -845,17 +844,17 @@ bool OpenGl_View::addRaytraceTriangleFanArray(OpenGl_TriangleSet& { for (int aVert = theOffset; aVert < theOffset + theCount - 2; ++aVert) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(theOffset), - theIndices->Index(aVert + 1), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(theOffset), + theIndices->Index(aVert + 1), + theIndices->Index(aVert + 2), + theMatID); } } else { for (int aVert = theOffset; aVert < theOffset + theCount - 2; ++aVert) { - theSet.Elements.push_back(BVH_Vec4i(theOffset, aVert + 1, aVert + 2, theMatID)); + theSet.Elements.emplace_back(theOffset, aVert + 1, aVert + 2, theMatID); } } @@ -885,10 +884,10 @@ bool OpenGl_View::addRaytraceTriangleStripArray( for (int aVert = theOffset, aCW = 0; aVert < theOffset + theCount - 2; ++aVert, aCW = (aCW + 1) % 2) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + (aCW ? 1 : 0)), - theIndices->Index(aVert + (aCW ? 0 : 1)), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(aVert + (aCW ? 1 : 0)), + theIndices->Index(aVert + (aCW ? 0 : 1)), + theIndices->Index(aVert + 2), + theMatID); } } else @@ -896,8 +895,10 @@ bool OpenGl_View::addRaytraceTriangleStripArray( for (int aVert = theOffset, aCW = 0; aVert < theOffset + theCount - 2; ++aVert, aCW = (aCW + 1) % 2) { - theSet.Elements.push_back( - BVH_Vec4i(aVert + (aCW ? 1 : 0), aVert + (aCW ? 0 : 1), aVert + 2, theMatID)); + theSet.Elements.emplace_back(aVert + (aCW ? 1 : 0), + aVert + (aCW ? 0 : 1), + aVert + 2, + theMatID); } } @@ -925,22 +926,22 @@ bool OpenGl_View::addRaytraceQuadrangleArray(OpenGl_TriangleSet& { for (int aVert = theOffset; aVert < theOffset + theCount - 3; aVert += 4) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + 0), - theIndices->Index(aVert + 1), - theIndices->Index(aVert + 2), - theMatID)); - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + 0), - theIndices->Index(aVert + 2), - theIndices->Index(aVert + 3), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(aVert + 0), + theIndices->Index(aVert + 1), + theIndices->Index(aVert + 2), + theMatID); + theSet.Elements.emplace_back(theIndices->Index(aVert + 0), + theIndices->Index(aVert + 2), + theIndices->Index(aVert + 3), + theMatID); } } else { for (int aVert = theOffset; aVert < theOffset + theCount - 3; aVert += 4) { - theSet.Elements.push_back(BVH_Vec4i(aVert + 0, aVert + 1, aVert + 2, theMatID)); - theSet.Elements.push_back(BVH_Vec4i(aVert + 0, aVert + 2, aVert + 3, theMatID)); + theSet.Elements.emplace_back(aVert + 0, aVert + 1, aVert + 2, theMatID); + theSet.Elements.emplace_back(aVert + 0, aVert + 2, aVert + 3, theMatID); } } @@ -969,24 +970,24 @@ bool OpenGl_View::addRaytraceQuadrangleStripArray( { for (int aVert = theOffset; aVert < theOffset + theCount - 3; aVert += 2) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + 0), - theIndices->Index(aVert + 1), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(aVert + 0), + theIndices->Index(aVert + 1), + theIndices->Index(aVert + 2), + theMatID); - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(aVert + 1), - theIndices->Index(aVert + 3), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(aVert + 1), + theIndices->Index(aVert + 3), + theIndices->Index(aVert + 2), + theMatID); } } else { for (int aVert = theOffset; aVert < theOffset + theCount - 3; aVert += 2) { - theSet.Elements.push_back(BVH_Vec4i(aVert + 0, aVert + 1, aVert + 2, theMatID)); + theSet.Elements.emplace_back(aVert + 0, aVert + 1, aVert + 2, theMatID); - theSet.Elements.push_back(BVH_Vec4i(aVert + 1, aVert + 3, aVert + 2, theMatID)); + theSet.Elements.emplace_back(aVert + 1, aVert + 3, aVert + 2, theMatID); } } @@ -1014,17 +1015,17 @@ bool OpenGl_View::addRaytracePolygonArray(OpenGl_TriangleSet& { for (int aVert = theOffset; aVert < theOffset + theCount - 2; ++aVert) { - theSet.Elements.push_back(BVH_Vec4i(theIndices->Index(theOffset), - theIndices->Index(aVert + 1), - theIndices->Index(aVert + 2), - theMatID)); + theSet.Elements.emplace_back(theIndices->Index(theOffset), + theIndices->Index(aVert + 1), + theIndices->Index(aVert + 2), + theMatID); } } else { for (int aVert = theOffset; aVert < theOffset + theCount - 2; ++aVert) { - theSet.Elements.push_back(BVH_Vec4i(theOffset, aVert + 1, aVert + 2, theMatID)); + theSet.Elements.emplace_back(theOffset, aVert + 1, aVert + 2, theMatID); } } @@ -2507,7 +2508,7 @@ bool OpenGl_View::uploadRaytraceData(const occ::handle& theGlCon ///////////////////////////////////////////////////////////////////////////// // Write material buffer - if (myRaytraceGeometry.Materials.size() != 0) + if (!myRaytraceGeometry.Materials.empty()) { aResult &= myRaytraceMaterialTexture->Init(theGlContext, 4, @@ -2672,7 +2673,7 @@ bool OpenGl_View::updateRaytraceLightSources(const NCollection_Mat4& myRaytraceLightSrcTexture = new OpenGl_TextureBuffer(); } - if (myRaytraceGeometry.Sources.size() != 0 && wasUpdated) + if (!myRaytraceGeometry.Sources.empty() && wasUpdated) { const GLfloat* aDataPtr = myRaytraceGeometry.Sources.front().Packed(); if (!myRaytraceLightSrcTexture->Init(theGlContext,