From 90f5d7b2145380aec63827c1eed16f36958232a5 Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Fri, 24 Apr 2026 21:47:27 +0100 Subject: [PATCH] Coding - Deprecate NCollection_Vector (#1230) - Updated multiple files to replace instances of NCollection_Vector with NCollection_DynamicArray --- .github/copilot-instructions.md | 2 +- .../BinLDrivers_DocumentRetrievalDriver.cxx | 4 +- .../BinLDrivers_DocumentRetrievalDriver.hxx | 10 +- .../BinLDrivers_DocumentStorageDriver.cxx | 2 +- .../BinLDrivers_DocumentStorageDriver.hxx | 4 +- .../TKDEGLTF/RWGltf/RWGltf_CafReader.cxx | 38 +- .../TKDEGLTF/RWGltf/RWGltf_CafReader.hxx | 10 +- .../TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.hxx | 4 +- .../TKDEOBJ/RWObj/RWObj_Reader.hxx | 19 +- .../RWObj/RWObj_TriangulationReader.hxx | 11 +- .../RWStepVisual_RWTessellatedCurveSet.cxx | 6 +- .../STEPCAFControl_GDTProperty.cxx | 6 +- .../STEPCAFControl/STEPCAFControl_Reader.cxx | 14 +- .../STEPCAFControl/STEPCAFControl_Writer.cxx | 8 +- .../STEPCAFControl/STEPCAFControl_Writer.hxx | 16 +- .../StepVisual_TessellatedCurveSet.cxx | 5 +- .../StepVisual_TessellatedCurveSet.hxx | 13 +- .../TKDESTL/DESTL/DESTL_Provider.cxx | 2 +- src/DataExchange/TKDESTL/RWStl/RWStl.cxx | 6 +- .../TKDEVRML/VrmlData/VrmlData_Geometry.cxx | 10 +- .../VrmlData/VrmlData_IndexedFaceSet.cxx | 6 +- .../TKDEVRML/VrmlData/VrmlData_Scene.cxx | 10 +- .../XCAFDimTolObjects_DimensionObject.cxx | 9 +- .../XCAFDimTolObjects_DimensionObject.hxx | 6 +- .../XCAFPrs/XCAFPrs_DocumentExplorer.hxx | 24 +- .../IFSelect/IFSelect_WorkSession.cxx | 4 +- .../IFSelect/IFSelect_WorkSession.hxx | 7 +- .../TKXSBase/Interface/Interface_Category.cxx | 6 +- .../Interface/Interface_ParamList.hxx | 4 +- .../XSControl/XSControl_Controller.hxx | 6 +- .../BOPDS_VectorOfCurve.hxx | 10 +- .../BOPDS_VectorOfFaceInfo.hxx | 10 +- .../BOPDS_VectorOfIndexRange.hxx | 12 +- .../BOPDS_VectorOfInterfEE.hxx | 10 +- .../BOPDS_VectorOfInterfEF.hxx | 10 +- .../BOPDS_VectorOfInterfEZ.hxx | 10 +- .../BOPDS_VectorOfInterfFF.hxx | 10 +- .../BOPDS_VectorOfInterfFZ.hxx | 10 +- .../BOPDS_VectorOfInterfVE.hxx | 10 +- .../BOPDS_VectorOfInterfVF.hxx | 10 +- .../BOPDS_VectorOfInterfVV.hxx | 10 +- .../BOPDS_VectorOfInterfVZ.hxx | 10 +- .../BOPDS_VectorOfInterfZZ.hxx | 10 +- .../BOPDS_VectorOfListOfPaveBlock.hxx | 10 +- .../NCollectionAliases/BOPDS_VectorOfPair.hxx | 10 +- .../BOPDS_VectorOfPoint.hxx | 10 +- .../BOPDS_VectorOfShapeInfo.hxx | 10 +- .../BOPDS_VectorOfVectorOfPair.hxx | 12 +- .../BinLDrivers_VectorOfDocumentSection.hxx | 13 +- .../GeomInt_VectorOfReal.hxx | 11 +- .../Interface_VectorOfFileParameter.hxx | 10 +- src/Draw/TKDraw/DBRep/DBRep.cxx | 9 +- src/Draw/TKDraw/DBRep/DBRep_Debug.cxx | 4 +- src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx | 53 +- src/Draw/TKDraw/DBRep/DBRep_DrawableShape.hxx | 36 +- src/Draw/TKQADraw/QABugs/QABugs_11.cxx | 10 +- .../BOPTest/BOPTest_DebugCommands.cxx | 61 +- .../GeometryTest/GeometryTest_APICommands.cxx | 4 +- src/Draw/TKTopTest/MeshTest/MeshTest.cxx | 4 +- .../TKViewerTest/ViewerTest/ViewerTest.cxx | 8 +- .../ViewerTest/ViewerTest_ObjectCommands.cxx | 8 +- .../TKMath/BVH/BVH_BinaryTree.hxx | 2 +- .../TKMath/BVH/BVH_LinearBuilder.hxx | 4 +- .../TKMath/BVH/BVH_ObjectSet.hxx | 2 +- .../TKMath/BVH/BVH_QueueBuilder.hxx | 4 +- .../TKMath/BVH/BVH_Types.hxx | 4 +- .../TKMath/Bnd/Bnd_BoundSortBox.cxx | 4 +- .../TKMath/Bnd/Bnd_BoundSortBox.hxx | 4 +- .../TKMath/CSLib/CSLib_Class2d.cxx | 14 +- .../TKMath/CSLib/CSLib_Class2d.hxx | 16 +- .../TKMath/GTests/MathOpt_GlobOpt_Test.cxx | 2 +- .../TKMath/GTests/MathOpt_PSO_Test.cxx | 10 +- .../TKMath/MathInteg/MathInteg_Kronrod.hxx | 4 +- .../TKMath/MathInteg/MathInteg_Multiple.hxx | 8 +- .../TKMath/MathOpt/MathOpt_BFGS.hxx | 8 +- .../TKMath/MathOpt/MathOpt_GlobOpt.hxx | 20 +- .../TKMath/MathOpt/MathOpt_PSO.hxx | 18 +- .../TKMath/MathRoot/MathRoot_All.hxx | 12 +- .../MathRoot/MathRoot_MultipleUtils.hxx | 12 +- .../Poly/Poly_CoherentTriangulation.cxx | 45 +- .../Poly/Poly_CoherentTriangulation.hxx | 30 +- .../TKernel/GTests/FILES.cmake | 1 - .../GTests/NCollection_BaseAllocator_Test.cxx | 12 +- .../GTests/NCollection_DynamicArray_Test.cxx | 791 ++++++++++++++++- .../GTests/NCollection_Vector_Test.cxx | 801 ------------------ .../TKernel/Message/Message.hxx | 2 +- .../NCollection_IndexedIterator.hxx | 2 +- .../NCollection/NCollection_Iterator.hxx | 2 +- .../NCollection/NCollection_SparseArray.hxx | 2 +- .../NCollection/NCollection_StlIterator.hxx | 2 +- .../NCollection/NCollection_UBTreeFiller.hxx | 10 +- .../NCollection/NCollection_Vector.hxx | 10 +- .../TKBO/BOPAlgo/BOPAlgo_Builder_2.cxx | 14 +- .../TKBO/BOPAlgo/BOPAlgo_Builder_3.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_Builder_4.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_CheckerSI.cxx | 52 +- .../TKBO/BOPAlgo/BOPAlgo_CheckerSI_1.cxx | 16 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller.hxx | 14 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_1.cxx | 6 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx | 6 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx | 16 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx | 12 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx | 14 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 170 ++-- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx | 24 +- .../TKBO/BOPAlgo/BOPAlgo_PaveFiller_9.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_Section.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx | 4 +- .../TKBO/BOPAlgo/BOPAlgo_Tools.cxx | 8 +- .../TKBO/BOPAlgo/BOPAlgo_WireSplitter.cxx | 4 +- .../TKBO/BOPDS/BOPDS_DS.cxx | 9 +- .../TKBO/BOPDS/BOPDS_DS.hxx | 66 +- .../TKBO/BOPDS/BOPDS_DS.lxx | 20 +- .../TKBO/BOPDS/BOPDS_Interf.hxx | 16 +- .../TKBO/BOPDS/BOPDS_Iterator.cxx | 6 +- .../TKBO/BOPDS/BOPDS_Iterator.hxx | 12 +- .../TKBO/BOPDS/BOPDS_SubIterator.hxx | 14 +- .../TKBO/BOPTools/BOPTools_AlgoTools_1.cxx | 12 +- .../TKBO/BOPTools/BOPTools_Set.hxx | 4 +- .../BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx | 8 +- .../TKBO/BRepAlgoAPI/BRepAlgoAPI_Section.cxx | 8 +- .../TKBO/IntTools/IntTools_FaceFace.cxx | 2 +- .../TKBool/BRepAlgo/BRepAlgo.cxx | 10 +- .../BRepFill/BRepFill_TrimShellCorner.cxx | 38 +- .../ApproxInt/ApproxInt_KnotTools.cxx | 10 +- .../ApproxInt/ApproxInt_KnotTools.hxx | 10 +- .../TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx | 4 +- .../TKGeomAlgo/GeomInt/GeomInt_IntSS.hxx | 12 +- .../TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx | 17 +- .../TKGeomAlgo/GeomInt/GeomInt_LineTool.cxx | 2 +- .../TKGeomAlgo/GeomInt/GeomInt_WLApprox.hxx | 4 +- .../IntCurveSurface/IntCurveSurface_Inter.pxx | 16 +- .../IntCurveSurface_InterUtils.pxx | 60 +- .../IntPatch/IntPatch_Intersection.cxx | 22 +- .../IntPatch/IntPatch_Intersection.hxx | 16 +- .../TKGeomAlgo/IntPolyh/IntPolyh_Array.hxx | 6 +- .../TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.hxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_Classifier.hxx | 4 +- .../TKMesh/BRepMesh/BRepMesh_Delaun.cxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_FaceChecker.hxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_Triangulator.cxx | 2 +- .../TKMesh/BRepMesh/BRepMesh_Triangulator.hxx | 6 +- .../GTests/BRepMesh_BaseMeshAlgo_Test.cxx | 5 +- .../TKMesh/IMeshData/IMeshData_Types.hxx | 24 +- .../BRepOffset/BRepOffset_MakeOffset.cxx | 22 +- .../BRepOffset/BRepOffset_MakeOffset_1.cxx | 18 +- .../BRepOffset/BRepOffset_SimpleOffset.cxx | 6 +- .../TKOffset/BRepOffset/BRepOffset_Tool.cxx | 36 +- .../ShapeAnalysis_CanonicalRecognition.cxx | 24 +- .../ShapeConstruct_ProjectCurveOnSurface.cxx | 6 +- .../BRepApprox/BRepApprox_Approx.hxx | 4 +- .../BRepBuilderAPI_FastSewing.cxx | 17 +- .../BRepBuilderAPI_FastSewing.hxx | 34 +- .../BRepBuilderAPI_VertexInspector.hxx | 4 +- .../TKTopAlgo/BRepCheck/BRepCheck_Solid.cxx | 4 +- .../BRepExtrema_DistShapeShape.cxx | 18 +- .../BRepExtrema_ProximityDistTool.cxx | 22 +- .../BRepExtrema_ProximityDistTool.hxx | 28 +- .../BRepExtrema_ProximityValueTool.cxx | 58 +- .../BRepExtrema_ProximityValueTool.hxx | 68 +- .../BRepExtrema_SelfIntersection.hxx | 2 +- .../BRepExtrema_ShapeProximity.cxx | 6 +- .../BRepExtrema_ShapeProximity.hxx | 4 +- .../BRepExtrema/BRepExtrema_TriangleSet.cxx | 5 +- .../BRepExtrema/BRepExtrema_TriangleSet.hxx | 10 +- .../TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx | 14 +- .../TKBRep/BRepGraph/BRepGraph.cxx | 16 +- .../TKBRep/BRepGraph/BRepGraph.hxx | 6 +- .../TKBRep/BRepGraph/BRepGraph_Builder.cxx | 2 +- .../TKBRep/BRepGraph/BRepGraph_Compact.cxx | 54 +- .../TKBRep/BRepGraph/BRepGraph_Copy.cxx | 38 +- .../TKBRep/BRepGraph/BRepGraph_Data.hxx | 8 +- .../BRepGraph/BRepGraph_Deduplicate.cxx | 60 +- .../BRepGraph/BRepGraph_Deduplicate.hxx | 6 +- .../BRepGraph/BRepGraph_DefsIterator.hxx | 52 +- .../TKBRep/BRepGraph/BRepGraph_EditorView.cxx | 135 +-- .../TKBRep/BRepGraph/BRepGraph_EditorView.hxx | 26 +- .../TKBRep/BRepGraph/BRepGraph_History.cxx | 64 +- .../TKBRep/BRepGraph/BRepGraph_History.hxx | 23 +- .../BRepGraph/BRepGraph_HistoryRecord.hxx | 4 +- .../TKBRep/BRepGraph/BRepGraph_Iterator.hxx | 4 +- .../TKBRep/BRepGraph/BRepGraph_Layer.cxx | 7 +- .../TKBRep/BRepGraph/BRepGraph_Layer.hxx | 8 +- .../TKBRep/BRepGraph/BRepGraph_LayerParam.cxx | 75 +- .../TKBRep/BRepGraph/BRepGraph_LayerParam.hxx | 20 +- .../BRepGraph/BRepGraph_LayerRegistry.cxx | 8 +- .../BRepGraph/BRepGraph_LayerRegistry.hxx | 20 +- .../BRepGraph/BRepGraph_LayerRegularity.cxx | 44 +- .../BRepGraph/BRepGraph_LayerRegularity.hxx | 10 +- .../TKBRep/BRepGraph/BRepGraph_MeshCache.cxx | 9 +- .../TKBRep/BRepGraph/BRepGraph_MeshCache.hxx | 18 +- .../BRepGraph/BRepGraph_ParentExplorer.cxx | 4 +- .../BRepGraph/BRepGraph_RefTransientCache.cxx | 16 +- .../BRepGraph/BRepGraph_RefTransientCache.hxx | 6 +- .../BRepGraph/BRepGraph_RefsIterator.hxx | 48 +- .../TKBRep/BRepGraph/BRepGraph_RefsView.cxx | 30 +- .../TKBRep/BRepGraph/BRepGraph_RefsView.hxx | 14 +- .../BRepGraph/BRepGraph_RelatedIterator.hxx | 6 +- .../BRepGraph/BRepGraph_ReverseIterator.hxx | 34 +- .../TKBRep/BRepGraph/BRepGraph_Tool.cxx | 4 +- .../TKBRep/BRepGraph/BRepGraph_TopoView.cxx | 113 +-- .../TKBRep/BRepGraph/BRepGraph_TopoView.hxx | 40 +- .../BRepGraph/BRepGraph_TransientCache.cxx | 24 +- .../BRepGraph/BRepGraph_TransientCache.hxx | 6 +- .../TKBRep/BRepGraph/BRepGraph_UIDsView.cxx | 12 +- .../TKBRep/BRepGraph/BRepGraph_Validate.cxx | 60 +- .../TKBRep/BRepGraph/BRepGraph_Validate.hxx | 4 +- src/ModelingData/TKBRep/BRepGraph/README.md | 2 +- .../BRepGraphInc/BRepGraphInc_Definition.hxx | 32 +- .../BRepGraphInc/BRepGraphInc_Populate.cxx | 145 ++-- .../BRepGraphInc/BRepGraphInc_Populate.hxx | 4 +- .../BRepGraphInc/BRepGraphInc_Reconstruct.cxx | 6 +- .../BRepGraphInc/BRepGraphInc_Reconstruct.hxx | 17 +- .../BRepGraphInc_ReverseIndex.cxx | 197 ++--- .../BRepGraphInc_ReverseIndex.hxx | 196 ++--- .../BRepGraphInc/BRepGraphInc_Storage.cxx | 19 +- .../BRepGraphInc/BRepGraphInc_Storage.hxx | 26 +- .../BRepTools/BRepTools_PurgeLocations.cxx | 6 +- .../TKBRep/GTests/BRepGraphInc_Test.cxx | 22 +- .../TKBRep/GTests/BRepGraph_Assembly_Test.cxx | 24 +- .../GTests/BRepGraph_Benchmark_Test.cxx | 6 +- .../TKBRep/GTests/BRepGraph_Build_Test.cxx | 8 +- .../TKBRep/GTests/BRepGraph_Builder_Test.cxx | 64 +- .../GTests/BRepGraph_ChildExplorer_Test.cxx | 21 +- .../GTests/BRepGraph_Convenience_Test.cxx | 6 +- .../GTests/BRepGraph_Deduplicate_Test.cxx | 32 +- .../BRepGraph_DeferredInvalidation_Test.cxx | 6 +- .../GTests/BRepGraph_DefsIterator_Test.cxx | 10 +- .../TKBRep/GTests/BRepGraph_EventBus_Test.cxx | 18 +- .../TKBRep/GTests/BRepGraph_Geometry_Test.cxx | 30 +- .../TKBRep/GTests/BRepGraph_History_Test.cxx | 106 +-- .../GTests/BRepGraph_MutationGen_Test.cxx | 4 +- .../TKBRep/GTests/BRepGraph_NodeId_Test.cxx | 2 +- .../GTests/BRepGraph_ParentExplorer_Test.cxx | 4 +- .../TKBRep/GTests/BRepGraph_Polygon_Test.cxx | 8 +- .../GTests/BRepGraph_Reconstruct_Test.cxx | 4 +- .../TKBRep/GTests/BRepGraph_RefId_Test.cxx | 2 +- .../TKBRep/GTests/BRepGraph_RefTestTools.hxx | 129 +-- .../GTests/BRepGraph_RefsIterator_Test.cxx | 8 +- .../GTests/BRepGraph_RelatedIterator_Test.cxx | 11 +- .../GTests/BRepGraph_ReplaceVertex_Test.cxx | 4 +- .../GTests/BRepGraph_ReverseIterator_Test.cxx | 22 +- .../GTests/BRepGraph_ScenarioMatrix_Test.cxx | 32 +- .../TKBRep/GTests/BRepGraph_Sharing_Test.cxx | 6 +- .../TKBRep/GTests/BRepGraph_Test.cxx | 186 ++-- .../TKBRep/GTests/BRepGraph_Validate_Test.cxx | 19 +- .../TKBRep/GTests/BRepGraph_Views_Test.cxx | 61 +- .../TKGeomBase/Extrema/Extrema_GGenExtCC.hxx | 4 +- .../TKGeomBase/Extrema/Extrema_GenExtPS.cxx | 6 +- .../TKGeomBase/ExtremaPC/ExtremaPC.hxx | 6 +- .../ExtremaPC/ExtremaPC_BSplineCurve.cxx | 4 +- .../ExtremaPC/ExtremaPC_GridEvaluator.hxx | 13 +- .../ProjLib/ProjLib_CompProjectedCurve.cxx | 12 +- .../TKIVtk/IVtkOCC/IVtkOCC_ViewerSelector.cxx | 4 +- .../MeshVS/MeshVS_CommonSensitiveEntity.hxx | 2 +- .../TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx | 8 +- .../TKOpenGl/OpenGl/OpenGl_Clipping.cxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Clipping.hxx | 4 +- .../OpenGl/OpenGl_ClippingIterator.hxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Context.cxx | 4 +- .../TKOpenGl/OpenGl/OpenGl_Font.cxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Font.hxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx | 54 +- .../TKOpenGl/OpenGl/OpenGl_FrameBuffer.hxx | 92 +- .../TKOpenGl/OpenGl/OpenGl_MatrixState.hxx | 4 +- .../TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Text.cxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_Text.hxx | 13 +- .../TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx | 36 +- .../TKOpenGl/OpenGl/OpenGl_TextBuilder.hxx | 22 +- .../TKOpenGl/OpenGl/OpenGl_View.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_View.hxx | 2 +- .../TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx | 6 +- .../TKOpenGl/OpenGl/OpenGl_Window.cxx | 2 +- .../TKService/Font/Font_TextFormatter.cxx | 16 +- .../TKService/Font/Font_TextFormatter.hxx | 18 +- .../TKService/Image/Image_Diff.cxx | 6 +- .../TKService/Image/Image_Diff.hxx | 4 +- .../TKV3d/AIS/AIS_ColoredShape.cxx | 2 +- .../TKV3d/AIS/AIS_ConnectedInteractive.cxx | 4 +- .../TKV3d/AIS/AIS_InteractiveContext.cxx | 2 +- .../TKV3d/AIS/AIS_PointCloud.cxx | 2 +- .../Select3D_InteriorSensitivePointSet.hxx | 2 +- .../Select3D/Select3D_SensitiveGroup.hxx | 2 +- .../TKV3d/Select3D/Select3D_SensitiveWire.cxx | 6 +- .../TKV3d/Select3D/Select3D_SensitiveWire.hxx | 6 +- .../SelectBasics_SelectingVolumeManager.hxx | 3 +- .../TKV3d/SelectMgr/SelectMgr.cxx | 7 +- .../SelectMgr/SelectMgr_BaseIntersector.hxx | 5 +- .../TKV3d/SelectMgr/SelectMgr_Frustum.lxx | 2 +- .../SelectMgr_RectangularFrustum.cxx | 4 +- .../SelectMgr_RectangularFrustum.hxx | 2 +- .../SelectMgr/SelectMgr_SelectableObject.cxx | 10 +- .../SelectMgr_SelectingVolumeManager.cxx | 2 +- .../SelectMgr_SelectingVolumeManager.hxx | 2 +- .../TKV3d/SelectMgr/SelectMgr_Selection.cxx | 12 +- .../TKV3d/SelectMgr/SelectMgr_Selection.hxx | 18 +- .../SelectMgr_SelectionImageFiller.cxx | 8 +- .../SelectMgr/SelectMgr_SelectionManager.cxx | 2 +- .../SelectMgr_SensitiveEntitySet.cxx | 4 +- .../SelectMgr/SelectMgr_TriangularFrustum.cxx | 2 +- .../SelectMgr/SelectMgr_TriangularFrustum.hxx | 2 +- .../SelectMgr_TriangularFrustumSet.cxx | 2 +- .../SelectMgr_TriangularFrustumSet.hxx | 2 +- .../SelectMgr/SelectMgr_ViewerSelector.cxx | 4 +- .../TKV3d/StdPrs/StdPrs_Isolines.cxx | 4 +- .../StdSelect/StdSelect_BRepSelectionTool.cxx | 4 +- 311 files changed, 3505 insertions(+), 3427 deletions(-) delete mode 100644 src/FoundationClasses/TKernel/GTests/NCollection_Vector_Test.cxx diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 182f61fd00..b01d7ad12b 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -129,7 +129,7 @@ Use standard C++ primitive types in all code. The old `Standard_*` typedefs are | `TCollection_AsciiString` | `std::string` | ASCII string | | `TCollection_ExtendedString` | `std::wstring` | Unicode string | | `NCollection_Array1` | `std::vector` | Fixed-size array (1-based) | -| `NCollection_Vector` | `std::vector` | Dynamic array | +| `NCollection_DynamicArray` | `std::vector` | Dynamic array | | `NCollection_List` | `std::list` | Doubly-linked list | | `NCollection_Sequence` | `std::deque` | Indexed sequence | | `NCollection_Map` | `std::unordered_set` | Hash set | diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx index 97f1c0c45d..5fc0f70847 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.cxx @@ -253,7 +253,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read(Standard_IStream& return; } - NCollection_Vector::Iterator anIterS(mySections); + NCollection_DynamicArray::Iterator anIterS(mySections); // if there is only empty section, do not call tellg and seekg if (!mySections.IsEmpty() && (mySections.Size() > 1 || !anIterS.Value().Name().IsEqual(ENDSECTION_POS))) @@ -382,7 +382,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read(Standard_IStream& // Read Sections (post-reading type) if (aFileVer >= TDocStd_FormatVersion_VERSION_3) { - NCollection_Vector::Iterator aSectIter(mySections); + NCollection_DynamicArray::Iterator aSectIter(mySections); for (; aSectIter.More(); aSectIter.Next()) { BinLDrivers_DocumentSection& aCurSection = aSectIter.ChangeValue(); diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx index d9da118917..03b7b90373 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentRetrievalDriver.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -117,10 +117,10 @@ protected: occ::handle myMsgDriver; private: - BinObjMgt_Persistent myPAtt; - NCollection_Map myMapUnsupported; - NCollection_Vector mySections; - NCollection_Map myUnresolvedLinks; + BinObjMgt_Persistent myPAtt; + NCollection_Map myMapUnsupported; + NCollection_DynamicArray mySections; + NCollection_Map myUnresolvedLinks; }; #endif // _BinLDrivers_DocumentRetrievalDriver_HeaderFile diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx index be8054e527..dc8b09f32e 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx @@ -110,7 +110,7 @@ void BinLDrivers_DocumentStorageDriver::Write(const occ::handle& t // 2. Write the Table of Contents of Sections const TDocStd_FormatVersion aDocVer = aDoc->StorageFormatVersion(); - NCollection_Vector::Iterator anIterS(mySections); + NCollection_DynamicArray::Iterator anIterS(mySections); for (; anIterS.More(); anIterS.Next()) anIterS.ChangeValue().WriteTOC(theOStream, aDocVer); diff --git a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.hxx b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.hxx index 658af9e832..5feb7c26ec 100644 --- a/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.hxx +++ b/src/ApplicationFramework/TKBinL/BinLDrivers/BinLDrivers_DocumentStorageDriver.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -125,7 +125,7 @@ private: NCollection_List myEmptyLabels; NCollection_Map> myMapUnsupported; NCollection_IndexedMap> myTypesMap; - NCollection_Vector mySections; + NCollection_DynamicArray mySections; TCollection_ExtendedString myFileName; //! Sizes of labels and some attributes that will be stored in the second pass NCollection_List> mySizesToWrite; diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx index 8f8bfd40de..cd5a5deaa5 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx @@ -40,9 +40,9 @@ class RWGltf_CafReader::CafReader_GltfBaseLoadingFunctor { public: //! Main constructor. - CafReader_GltfBaseLoadingFunctor(NCollection_Vector& theFaceList, - const Message_ProgressRange& theProgress, - const OSD_ThreadPool::Launcher& theThreadPool) + CafReader_GltfBaseLoadingFunctor(NCollection_DynamicArray& theFaceList, + const Message_ProgressRange& theProgress, + const OSD_ThreadPool::Launcher& theThreadPool) : myFaceList(&theFaceList), myProgress(theProgress, "Loading glTF triangulation", std::max(1, theFaceList.Length())), myThreadPool(theThreadPool) @@ -83,10 +83,10 @@ protected: int theThreadIndex) const = 0; protected: - NCollection_Vector* myFaceList; - mutable std::mutex myMutex; - mutable Message_ProgressScope myProgress; - const OSD_ThreadPool::Launcher& myThreadPool; + NCollection_DynamicArray* myFaceList; + mutable std::mutex myMutex; + mutable Message_ProgressScope myProgress; + const OSD_ThreadPool::Launcher& myThreadPool; }; //! Functor for parallel execution of all glTF data loading. @@ -100,10 +100,10 @@ public: }; //! Main constructor. - CafReader_GltfFullDataLoadingFunctor(RWGltf_CafReader* myCafReader, - NCollection_Vector& theFaceList, - const Message_ProgressRange& theProgress, - const OSD_ThreadPool::Launcher& theThreadPool) + CafReader_GltfFullDataLoadingFunctor(RWGltf_CafReader* myCafReader, + NCollection_DynamicArray& theFaceList, + const Message_ProgressRange& theProgress, + const OSD_ThreadPool::Launcher& theThreadPool) : CafReader_GltfBaseLoadingFunctor(theFaceList, theProgress, theThreadPool), myCafReader(myCafReader), myTlsData(theThreadPool.LowerThreadIndex(), theThreadPool.UpperThreadIndex()) @@ -147,9 +147,9 @@ class RWGltf_CafReader::CafReader_GltfStreamDataLoadingFunctor { public: //! Main constructor. - CafReader_GltfStreamDataLoadingFunctor(NCollection_Vector& theFaceList, - const Message_ProgressRange& theProgress, - const OSD_ThreadPool::Launcher& theThreadPool) + CafReader_GltfStreamDataLoadingFunctor(NCollection_DynamicArray& theFaceList, + const Message_ProgressRange& theProgress, + const OSD_ThreadPool::Launcher& theThreadPool) : CafReader_GltfBaseLoadingFunctor(theFaceList, theProgress, theThreadPool) { // @@ -365,9 +365,9 @@ occ::handle RWGltf_CafReader::createMeshReaderContex //================================================================================================= -bool RWGltf_CafReader::readLateData(NCollection_Vector& theFaces, - const TCollection_AsciiString& theFile, - const Message_ProgressRange& theProgress) +bool RWGltf_CafReader::readLateData(NCollection_DynamicArray& theFaces, + const TCollection_AsciiString& theFile, + const Message_ProgressRange& theProgress) { occ::handle aReader = occ::down_cast(createMeshReaderContext()); @@ -407,11 +407,11 @@ bool RWGltf_CafReader::readLateData(NCollection_Vector& theFaces, //================================================================================================= void RWGltf_CafReader::updateLateDataReader( - NCollection_Vector& theFaces, + NCollection_DynamicArray& theFaces, const occ::handle& theReader) const { TopLoc_Location aDummyLoc; - for (NCollection_Vector::Iterator aFaceIter(theFaces); aFaceIter.More(); + for (NCollection_DynamicArray::Iterator aFaceIter(theFaces); aFaceIter.More(); aFaceIter.Next()) { const TopoDS_Face& aFace = aFaceIter.Value(); diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.hxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.hxx index 47338557c1..3d7f1ed32c 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.hxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.hxx @@ -15,7 +15,7 @@ #ifndef _RWGltf_CafReader_HeaderFile #define _RWGltf_CafReader_HeaderFile -#include +#include #include #include @@ -113,13 +113,13 @@ protected: Standard_EXPORT virtual occ::handle createMeshReaderContext() const; //! Read late data from RWGltf_GltfLatePrimitiveArray stored as Poly_Triangulation within faces. - Standard_EXPORT virtual bool readLateData(NCollection_Vector& theFaces, - const TCollection_AsciiString& theFile, - const Message_ProgressRange& theProgress); + Standard_EXPORT virtual bool readLateData(NCollection_DynamicArray& theFaces, + const TCollection_AsciiString& theFile, + const Message_ProgressRange& theProgress); //! Set reader for each late data. Standard_EXPORT void updateLateDataReader( - NCollection_Vector& theFaces, + NCollection_DynamicArray& theFaces, const occ::handle& theReader) const; protected: diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.hxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.hxx index 9bfea31fbe..5b536035ee 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.hxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.hxx @@ -144,7 +144,7 @@ public: Standard_EXPORT bool Parse(const Message_ProgressRange& theProgress); //! Return face list for loading triangulation. - NCollection_Vector& FaceList() { return myFaceList; } + NCollection_DynamicArray& FaceList() { return myFaceList; } //! Set inpit stream. void SetStream(std::shared_ptr& theStream) { myStream = theStream; } @@ -503,7 +503,7 @@ protected: NCollection_DataMap myProbedFiles; NCollection_DataMap> myDecodedBuffers; - NCollection_Vector myFaceList; //!< face list for loading triangulation + NCollection_DynamicArray myFaceList; //!< face list for loading triangulation TCollection_AsciiString myFilePath; //!< file path TCollection_AsciiString myFolder; //!< folder diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.hxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.hxx index 3568362bf1..873829d93c 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.hxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.hxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -306,11 +306,11 @@ protected: { if (myIsSinglePrecision) { - myVec3Vec = new NCollection_Shared>>(); + myVec3Vec = new NCollection_Shared>>(); } else { - myPntVec = new NCollection_Shared>(); + myPntVec = new NCollection_Shared>(); } } @@ -349,9 +349,9 @@ protected: } private: - Handle(NCollection_Shared>) myPntVec; - Handle(NCollection_Shared>>) myVec3Vec; - bool myIsSinglePrecision; + Handle(NCollection_Shared>) myPntVec; + Handle(NCollection_Shared>>) myVec3Vec; + bool myIsSinglePrecision; }; protected: @@ -375,9 +375,10 @@ protected: // set of nodal properties defines Vertex (thus node at the same location but with different // normal should be duplicated). The following code converts OBJ definition of nodal properties to // Primitive Array definition. - VectorOfVertices myObjVerts; //!< temporary vector of vertices - NCollection_Vector> myObjVertsUV; //!< temporary vector of UV parameters - NCollection_Vector> myObjNorms; //!< temporary vector of normals + VectorOfVertices myObjVerts; //!< temporary vector of vertices + NCollection_DynamicArray> + myObjVertsUV; //!< temporary vector of UV parameters + NCollection_DynamicArray> myObjNorms; //!< temporary vector of normals NCollection_DataMap, int, ObjVec3iHasher> myPackedIndices; NCollection_DataMap myMaterials; //!< map of known materials diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_TriangulationReader.hxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_TriangulationReader.hxx index c55fd65ba2..0132f31ba3 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_TriangulationReader.hxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_TriangulationReader.hxx @@ -102,12 +102,13 @@ protected: const bool theToExpandCompound); protected: - NCollection_Vector myNodes; //!< nodes of currently filled triangulation - NCollection_Vector> + NCollection_DynamicArray myNodes; //!< nodes of currently filled triangulation + NCollection_DynamicArray> myNormals; //!< normals of currently filled triangulation - NCollection_Vector> - myNodesUV; //!< UVs of currently filled triangulation - NCollection_Vector myTriangles; //!< indexes of currently filled triangulation + NCollection_DynamicArray> + myNodesUV; //!< UVs of currently filled triangulation + NCollection_DynamicArray + myTriangles; //!< indexes of currently filled triangulation RWObj_IShapeReceiver* myShapeReceiver; //!< optional shape receiver TopoDS_Compound myResultShape; //!< result shape as Compound of objects diff --git a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx index d5b7e1268d..70e3641293 100644 --- a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx +++ b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWTessellatedCurveSet.cxx @@ -46,9 +46,9 @@ void RWStepVisual_RWTessellatedCurveSet::ReadStep( data ->ReadEntity(num, 2, "coord_list", ach, STANDARD_TYPE(StepVisual_CoordinatesList), aCoordList); //--- Initialisation of the read entity --- - int nsub2; - NCollection_Handle>>> aCurves = - new NCollection_Vector>>; + int nsub2; + NCollection_Handle>>> aCurves = + new NCollection_DynamicArray>>; if (data->ReadSubList(num, 3, "curves", ach, nsub2)) { int nb2 = data->NbParams(nsub2); diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 907a594cc6..da339e6a10 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -238,13 +238,13 @@ occ::handle GenerateComplexTriangulate occ::handle GenerateTessellatedCurveSet( const TopoDS_Shape& theShape) { - NCollection_Handle>>> aLineStrips = - new NCollection_Vector>>; + NCollection_Handle>>> + aLineStrips = new NCollection_DynamicArray>>; // Temporary contanier for points. We need points in NCollection_HArray1 type of // container, however in order to create it we need to know it's size. // Currently number of points is unknown, so we will put all the points in a // temporary container and then just copy them after all edges will be processed. - NCollection_Vector aTmpPointsContainer; + NCollection_DynamicArray aTmpPointsContainer; for (TopExp_Explorer aCurveIt(theShape, TopAbs_EDGE); aCurveIt.More(); aCurveIt.Next()) { // Find out type of edge curve diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx index c1c866cb4f..378c4cf132 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -225,7 +225,7 @@ #include #include #include -#include +#include #include #include #include @@ -1189,7 +1189,7 @@ static void SetStyle( return; // collect styled items - NCollection_Vector anItems; + NCollection_DynamicArray anItems; if (!theStyle->ItemAP242().IsNull()) { anItems.Append(theStyle->ItemAP242()); @@ -2271,9 +2271,9 @@ bool readPMIPresentation(const occ::handle& thePresent { return false; } - occ::handle aTP = theTR->TransientProcess(); - occ::handle anAO; - NCollection_Vector> anAnnotations; + occ::handle aTP = theTR->TransientProcess(); + occ::handle anAO; + NCollection_DynamicArray> anAnnotations; if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationOccurrence)) || thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_TessellatedAnnotationOccurrence))) { @@ -2392,8 +2392,8 @@ bool readPMIPresentation(const occ::handle& thePresent continue; } - NCollection_Handle>>> aCurves = - aTessCurve->Curves(); + NCollection_Handle>>> + aCurves = aTessCurve->Curves(); int aNbCurves = (aCurves.IsNull() ? 0 : aCurves->Length()); for (int k = 0; k < aNbCurves; k++) { diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx index 9974b73cf8..fe23587757 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -3561,7 +3561,7 @@ static void WriteDerivedGeometry( const occ::handle& theRepr, occ::handle& theFirstSA, occ::handle& theSecondSA, - NCollection_Vector>& thePnts, + NCollection_DynamicArray>& thePnts, const StepData_Factors& theLocalFactors) { const occ::handle& aModel = theWS->Model(); @@ -4628,9 +4628,9 @@ bool STEPCAFControl_Writer::writeDGTsAP242(const occ::handle aCGReprRel = new StepRepr_ConstructiveGeometryRepresentationRelationship(); - NCollection_Vector> aConnectionPnts; - occ::handle dummyRC; - occ::handle dummyGISU; + NCollection_DynamicArray> aConnectionPnts; + occ::handle dummyRC; + occ::handle dummyGISU; for (NCollection_Sequence::Iterator aDGTIter(aDGTLabels); aDGTIter.More(); aDGTIter.Next()) { diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.hxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.hxx index 9287d449be..2ce36b262b 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.hxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -426,13 +426,13 @@ private: bool myMetadataMode; bool mySHUOMode; NCollection_DataMap, TopTools_ShapeMapHasher> - myMapCompMDGPR; - bool myGDTMode; - bool myMatMode; - bool myVisMatMode; - bool myIsCleanDuplicates; - NCollection_Vector> myGDTAnnotations; - occ::handle myGDTPresentationDM; + myMapCompMDGPR; + bool myGDTMode; + bool myMatMode; + bool myVisMatMode; + bool myIsCleanDuplicates; + NCollection_DynamicArray> myGDTAnnotations; + occ::handle myGDTPresentationDM; occ::handle>> myGDTPrsCurveStyle; occ::handle myGDTCommonPDS; diff --git a/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.cxx b/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.cxx index 7cd279df71..f495317bce 100644 --- a/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.cxx +++ b/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.cxx @@ -21,14 +21,15 @@ StepVisual_TessellatedCurveSet::StepVisual_TessellatedCurveSet() = default; void StepVisual_TessellatedCurveSet::Init( const occ::handle& theName, const occ::handle& theCoordList, - const NCollection_Handle>>>& theCurves) + const NCollection_Handle>>>& + theCurves) { StepRepr_RepresentationItem::Init(theName); myCoordList = theCoordList; myCurves = theCurves; } -NCollection_Handle>>> +NCollection_Handle>>> StepVisual_TessellatedCurveSet::Curves() const { return myCurves; diff --git a/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.hxx b/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.hxx index 2554f109c9..d4e355b134 100644 --- a/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.hxx +++ b/src/DataExchange/TKDESTEP/StepVisual/StepVisual_TessellatedCurveSet.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -38,16 +38,17 @@ public: Standard_EXPORT void Init( const occ::handle& theName, const occ::handle& theCoordList, - const NCollection_Handle>>>& + const NCollection_Handle>>>& theCurves); Standard_EXPORT occ::handle CoordList() const; - Standard_EXPORT NCollection_Handle>>> - Curves() const; + Standard_EXPORT NCollection_Handle< + NCollection_DynamicArray>>> + Curves() const; private: - occ::handle myCoordList; - NCollection_Handle>>> myCurves; + occ::handle myCoordList; + NCollection_Handle>>> myCurves; public: DEFINE_STANDARD_RTTIEXT(StepVisual_TessellatedCurveSet, StepVisual_TessellatedItem) diff --git a/src/DataExchange/TKDESTL/DESTL/DESTL_Provider.cxx b/src/DataExchange/TKDESTL/DESTL/DESTL_Provider.cxx index f6edb556db..02ae59789e 100644 --- a/src/DataExchange/TKDESTL/DESTL/DESTL_Provider.cxx +++ b/src/DataExchange/TKDESTL/DESTL/DESTL_Provider.cxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/DataExchange/TKDESTL/RWStl/RWStl.cxx b/src/DataExchange/TKDESTL/RWStl/RWStl.cxx index ea7d605cd7..53e7e5330b 100644 --- a/src/DataExchange/TKDESTL/RWStl/RWStl.cxx +++ b/src/DataExchange/TKDESTL/RWStl/RWStl.cxx @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -112,8 +112,8 @@ protected: } private: - NCollection_Vector myNodes; - NCollection_Vector myTriangles; + NCollection_DynamicArray myNodes; + NCollection_DynamicArray myTriangles; }; class MultiDomainReader : public Reader diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx index 1ba38f8f5e..004970ecf2 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include IMPLEMENT_STANDARD_RTTIEXT(VrmlData_Geometry, VrmlData_Node) @@ -468,8 +468,8 @@ occ::handle VrmlData_TextureCoordinate::Clone( VrmlData_ErrorStatus VrmlData_TextureCoordinate::Read(VrmlData_InBuffer& theBuffer) { - VrmlData_ErrorStatus aStatus; - NCollection_Vector vecValues; + VrmlData_ErrorStatus aStatus; + NCollection_DynamicArray vecValues; if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { // Match the name with the current word in the stream @@ -545,8 +545,8 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray(VrmlData_InBuffer& theBuffer const char* theName, const bool isScale) { - VrmlData_ErrorStatus aStatus; - NCollection_Vector vecValues; + VrmlData_ErrorStatus aStatus; + NCollection_DynamicArray vecValues; if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) { // Match the name with the current word in the stream diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx index de29a39e98..a6e2fa9949 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_IndexedFaceSet.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -159,8 +159,8 @@ const occ::handle& VrmlData_IndexedFaceSet::TShape() return myTShape; } // prepare vector of nodes - NCollection_Vector aNodes; - NCollection_DataMap mapIdId; + NCollection_DynamicArray aNodes; + NCollection_DataMap mapIdId; for (i = 0; i < nNodes; i++) { if (mapNodeId.Contains(i)) diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx index 830a6b166c..364c937164 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx @@ -32,7 +32,7 @@ #include #include // #include -#include +#include #include #include #include @@ -825,10 +825,10 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex(VrmlData_InBuffer& theBuffer, else { theBuffer.LinePtr++; - NCollection_Vector vecIndice; - NCollection_Vector vecInt; - bool isMore(true); - long anIntValue; + NCollection_DynamicArray vecIndice; + NCollection_DynamicArray vecInt; + bool isMore(true); + long anIntValue; // Loop reading integers from the stream while (isMore && VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) diff --git a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx index 89de9b18fe..25abfe272e 100644 --- a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx +++ b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx @@ -430,8 +430,8 @@ void XCAFDimTolObjects_DimensionObject::RemoveDescription(const int theNumber) { if (theNumber < myDescriptions.Lower() || theNumber > myDescriptions.Upper()) return; - NCollection_Vector> aDescriptions; - NCollection_Vector> aDescriptionNames; + NCollection_DynamicArray> aDescriptions; + NCollection_DynamicArray> aDescriptionNames; for (int i = aDescriptions.Lower(); i < theNumber; i++) { aDescriptions.Append(myDescriptions.Value(i)); @@ -553,7 +553,8 @@ void XCAFDimTolObjects_DimensionObject::DumpJson(Standard_OStream& theOStream, i OCCT_DUMP_FIELD_VALUE_STRING(theOStream, aPresentationName) } - for (NCollection_Vector>::Iterator aDescIt(myDescriptions); + for (NCollection_DynamicArray>::Iterator aDescIt( + myDescriptions); aDescIt.More(); aDescIt.Next()) { @@ -563,7 +564,7 @@ void XCAFDimTolObjects_DimensionObject::DumpJson(Standard_OStream& theOStream, i OCCT_DUMP_FIELD_VALUE_STRING(theOStream, aDescription) } - for (NCollection_Vector>::Iterator aDescNameIt( + for (NCollection_DynamicArray>::Iterator aDescNameIt( myDescriptionNames); aDescNameIt.More(); aDescNameIt.Next()) diff --git a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx index c48c9e4cb4..fa597a1dd4 100644 --- a/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx +++ b/src/DataExchange/TKXCAF/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include class XCAFDimTolObjects_DimensionObject; @@ -377,8 +377,8 @@ private: TopoDS_Shape myPresentation; occ::handle mySemanticName; occ::handle myPresentationName; - NCollection_Vector> myDescriptions; - NCollection_Vector> myDescriptionNames; + NCollection_DynamicArray> myDescriptions; + NCollection_DynamicArray> myDescriptionNames; }; #endif // _XCAFDimTolObjects_DimensionObject_HeaderFile diff --git a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.hxx b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.hxx index 31e12fc686..30bafd48c2 100644 --- a/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.hxx +++ b/src/DataExchange/TKXCAF/XCAFPrs/XCAFPrs_DocumentExplorer.hxx @@ -15,7 +15,7 @@ #ifndef _XCAFPrs_DocumentExplorer_HeaderFile #define _XCAFPrs_DocumentExplorer_HeaderFile -#include +#include #include #include #include @@ -167,18 +167,18 @@ protected: Standard_EXPORT void initCurrent(bool theIsAssembly); protected: - occ::handle myColorTool; //!< color tool - occ::handle myVisMatTool; //!< visual material tool - NCollection_Sequence myRoots; //!< sequence of root labels - NCollection_Sequence::Iterator myRootIter; //!< current root label - NCollection_Vector myNodeStack; //!< node stack - int myTop; //!< top position in the node stack - // clang-format off + occ::handle myColorTool; //!< color tool + occ::handle myVisMatTool; //!< visual material tool + NCollection_Sequence myRoots; //!< sequence of root labels + NCollection_Sequence::Iterator myRootIter; //!< current root label + NCollection_DynamicArray myNodeStack; //!< node stack + int myTop; //!< top position in the node stack + // clang-format off bool myHasMore; //!< global flag indicating that iterator points to the label - // clang-format on - XCAFPrs_Style myDefStyle; //!< default style - XCAFPrs_DocumentNode myCurrent; //!< current label info - XCAFPrs_DocumentExplorerFlags myFlags; //!< iteration flags + // clang-format on + XCAFPrs_Style myDefStyle; //!< default style + XCAFPrs_DocumentNode myCurrent; //!< current label info + XCAFPrs_DocumentExplorerFlags myFlags; //!< iteration flags }; #endif // _XCAFPrs_DocumentExplorer_HeaderFile diff --git a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx index 0363f95676..eec2420f91 100644 --- a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx +++ b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.cxx @@ -2678,8 +2678,8 @@ int IFSelect_WorkSession::QueryParent(const occ::handle& ent //================================================================================================= void IFSelect_WorkSession::SetParams( - const NCollection_Vector>& params, - const NCollection_Vector& uselist) + const NCollection_DynamicArray>& params, + const NCollection_DynamicArray& uselist) { int i, nbp = params.Length(), nbu = uselist.Length(); occ::handle editor = diff --git a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.hxx b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.hxx index e068f37e09..4df3a31787 100644 --- a/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.hxx +++ b/src/DataExchange/TKXSBase/IFSelect/IFSelect_WorkSession.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -1027,8 +1027,9 @@ public: //! xst-params-split 4 Split //! xst-param-read 5 Transfer on Reading //! xst-param-write 6 Transfer on Writing - Standard_EXPORT void SetParams(const NCollection_Vector>& params, - const NCollection_Vector& uselist); + Standard_EXPORT void SetParams( + const NCollection_DynamicArray>& params, + const NCollection_DynamicArray& uselist); //! Traces the Statics attached to a given use number //! If is given positive (normal), the trace is embedded diff --git a/src/DataExchange/TKXSBase/Interface/Interface_Category.cxx b/src/DataExchange/TKXSBase/Interface/Interface_Category.cxx index 5789ca1db2..eeca4fdc5c 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_Category.cxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_Category.cxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include @@ -28,9 +28,9 @@ static const char* unspec = "unspecified"; static volatile bool gMapTypesInit = false; -static NCollection_Vector& theCats() +static NCollection_DynamicArray& theCats() { - static NCollection_Vector aCat; + static NCollection_DynamicArray aCat; return aCat; } diff --git a/src/DataExchange/TKXSBase/Interface/Interface_ParamList.hxx b/src/DataExchange/TKXSBase/Interface/Interface_ParamList.hxx index 771233d610..2accf94ddc 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_ParamList.hxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_ParamList.hxx @@ -18,7 +18,7 @@ #include -#include +#include #include #include #include @@ -62,7 +62,7 @@ public: DEFINE_STANDARD_RTTIEXT(Interface_ParamList, Standard_Transient) private: - NCollection_Vector myVector; + NCollection_DynamicArray myVector; }; #include diff --git a/src/DataExchange/TKXSBase/XSControl/XSControl_Controller.hxx b/src/DataExchange/TKXSBase/XSControl/XSControl_Controller.hxx index 535e54ce5c..8cadfd8435 100644 --- a/src/DataExchange/TKXSBase/XSControl/XSControl_Controller.hxx +++ b/src/DataExchange/TKXSBase/XSControl/XSControl_Controller.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -227,8 +227,8 @@ protected: private: NCollection_Sequence> myAdaptorApplied; - NCollection_Vector> myParams; - NCollection_Vector myParamUses; + NCollection_DynamicArray> myParams; + NCollection_DynamicArray myParamUses; occ::handle>> myModeWriteShapeN; }; diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfCurve.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfCurve.hxx index 9ebd93b01c..16daa88bf7 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfCurve.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfCurve.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfCurve.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfCurve_hxx #define _BOPDS_VectorOfCurve_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfCurve.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfCurve is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfCurve; + "BOPDS_VectorOfCurve is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfCurve; #endif // _BOPDS_VectorOfCurve_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfFaceInfo.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfFaceInfo.hxx index 70c3c25168..4e810c816d 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfFaceInfo.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfFaceInfo.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfFaceInfo.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfFaceInfo_hxx #define _BOPDS_VectorOfFaceInfo_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfFaceInfo.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfFaceInfo is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfFaceInfo; + "BOPDS_VectorOfFaceInfo is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfFaceInfo; #endif // _BOPDS_VectorOfFaceInfo_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfIndexRange.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfIndexRange.hxx index 25bacd2828..828ad1bf79 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfIndexRange.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfIndexRange.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfIndexRange.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfIndexRange_hxx #define _BOPDS_VectorOfIndexRange_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfIndexRange.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") - Standard_DEPRECATED( - "BOPDS_VectorOfIndexRange is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfIndexRange; + Standard_DEPRECATED("BOPDS_VectorOfIndexRange is deprecated, use " + "NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfIndexRange; #endif // _BOPDS_VectorOfIndexRange_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEE.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEE.hxx index 188d11e2c2..b7d225c427 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEE.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEE.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfEE.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfEE_hxx #define _BOPDS_VectorOfInterfEE_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfEE.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfEE is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfEE; + "BOPDS_VectorOfInterfEE is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfEE; #endif // _BOPDS_VectorOfInterfEE_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEF.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEF.hxx index 38884fd83e..4369259079 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEF.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEF.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfEF.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfEF_hxx #define _BOPDS_VectorOfInterfEF_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfEF.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfEF is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfEF; + "BOPDS_VectorOfInterfEF is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfEF; #endif // _BOPDS_VectorOfInterfEF_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEZ.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEZ.hxx index a85c6473b9..3ffa8a60f1 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEZ.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfEZ.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfEZ.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfEZ_hxx #define _BOPDS_VectorOfInterfEZ_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfEZ.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfEZ is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfEZ; + "BOPDS_VectorOfInterfEZ is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfEZ; #endif // _BOPDS_VectorOfInterfEZ_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFF.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFF.hxx index 5b0086c0e0..74b8e35eab 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFF.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFF.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfFF.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfFF_hxx #define _BOPDS_VectorOfInterfFF_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfFF.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfFF is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfFF; + "BOPDS_VectorOfInterfFF is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfFF; #endif // _BOPDS_VectorOfInterfFF_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFZ.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFZ.hxx index ba319b2a3e..3d44b2d1b6 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFZ.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfFZ.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfFZ.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfFZ_hxx #define _BOPDS_VectorOfInterfFZ_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfFZ.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfFZ is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfFZ; + "BOPDS_VectorOfInterfFZ is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfFZ; #endif // _BOPDS_VectorOfInterfFZ_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVE.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVE.hxx index f5766f2c94..ce3d8f6d7e 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVE.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVE.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfVE.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfVE_hxx #define _BOPDS_VectorOfInterfVE_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfVE.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfVE is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfVE; + "BOPDS_VectorOfInterfVE is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfVE; #endif // _BOPDS_VectorOfInterfVE_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVF.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVF.hxx index 413f050498..236030b86c 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVF.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVF.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfVF.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfVF_hxx #define _BOPDS_VectorOfInterfVF_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfVF.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfVF is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfVF; + "BOPDS_VectorOfInterfVF is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfVF; #endif // _BOPDS_VectorOfInterfVF_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVV.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVV.hxx index ba06f388c9..6830da3002 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVV.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVV.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfVV.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfVV_hxx #define _BOPDS_VectorOfInterfVV_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfVV.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfVV is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfVV; + "BOPDS_VectorOfInterfVV is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfVV; #endif // _BOPDS_VectorOfInterfVV_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVZ.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVZ.hxx index d77843c2e6..15002ddb31 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVZ.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfVZ.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfVZ.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfVZ_hxx #define _BOPDS_VectorOfInterfVZ_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfVZ.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfVZ is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfVZ; + "BOPDS_VectorOfInterfVZ is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfVZ; #endif // _BOPDS_VectorOfInterfVZ_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfZZ.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfZZ.hxx index f166dd4653..cfba8feba6 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfZZ.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfInterfZZ.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfInterfZZ.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfInterfZZ_hxx #define _BOPDS_VectorOfInterfZZ_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfInterfZZ.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfInterfZZ is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfInterfZZ; + "BOPDS_VectorOfInterfZZ is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfInterfZZ; #endif // _BOPDS_VectorOfInterfZZ_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfListOfPaveBlock.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfListOfPaveBlock.hxx index 3012f27bb6..636966d156 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfListOfPaveBlock.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfListOfPaveBlock.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfListOfPaveBlock.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfListOfPaveBlock_hxx #define _BOPDS_VectorOfListOfPaveBlock_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfListOfPaveBlock.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED("BOPDS_VectorOfListOfPaveBlock is deprecated, use " - "NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfListOfPaveBlock; + "NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfListOfPaveBlock; #endif // _BOPDS_VectorOfListOfPaveBlock_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPair.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPair.hxx index b493ae1199..dd5d7b1b95 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPair.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPair.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfPair.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfPair_hxx #define _BOPDS_VectorOfPair_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfPair.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfPair is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfPair; + "BOPDS_VectorOfPair is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfPair; #endif // _BOPDS_VectorOfPair_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPoint.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPoint.hxx index 881f31e3ba..abf7f6574c 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPoint.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfPoint.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfPoint.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfPoint_hxx #define _BOPDS_VectorOfPoint_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfPoint.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfPoint is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfPoint; + "BOPDS_VectorOfPoint is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfPoint; #endif // _BOPDS_VectorOfPoint_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfShapeInfo.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfShapeInfo.hxx index 01d9001020..19bfeaecee 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfShapeInfo.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfShapeInfo.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfShapeInfo.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfShapeInfo_hxx #define _BOPDS_VectorOfShapeInfo_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfShapeInfo.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") Standard_DEPRECATED( - "BOPDS_VectorOfShapeInfo is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfShapeInfo; + "BOPDS_VectorOfShapeInfo is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfShapeInfo; #endif // _BOPDS_VectorOfShapeInfo_hxx diff --git a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfVectorOfPair.hxx b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfVectorOfPair.hxx index 507c20c51f..9f905fdfb1 100644 --- a/src/Deprecated/NCollectionAliases/BOPDS_VectorOfVectorOfPair.hxx +++ b/src/Deprecated/NCollectionAliases/BOPDS_VectorOfVectorOfPair.hxx @@ -14,20 +14,20 @@ //! @file BOPDS_VectorOfVectorOfPair.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BOPDS_VectorOfVectorOfPair_hxx #define _BOPDS_VectorOfVectorOfPair_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("BOPDS_VectorOfVectorOfPair.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") - Standard_DEPRECATED( - "BOPDS_VectorOfVectorOfPair is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector BOPDS_VectorOfVectorOfPair; + Standard_DEPRECATED("BOPDS_VectorOfVectorOfPair is deprecated, use " + "NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BOPDS_VectorOfVectorOfPair; #endif // _BOPDS_VectorOfVectorOfPair_hxx diff --git a/src/Deprecated/NCollectionAliases/BinLDrivers_VectorOfDocumentSection.hxx b/src/Deprecated/NCollectionAliases/BinLDrivers_VectorOfDocumentSection.hxx index 1fec8e8dd7..4195b4ff50 100644 --- a/src/Deprecated/NCollectionAliases/BinLDrivers_VectorOfDocumentSection.hxx +++ b/src/Deprecated/NCollectionAliases/BinLDrivers_VectorOfDocumentSection.hxx @@ -14,20 +14,21 @@ //! @file BinLDrivers_VectorOfDocumentSection.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _BinLDrivers_VectorOfDocumentSection_hxx #define _BinLDrivers_VectorOfDocumentSection_hxx #include -#include +#include #include -Standard_HEADER_DEPRECATED("BinLDrivers_VectorOfDocumentSection.hxx is deprecated since OCCT " - "8.0.0. Use NCollection_Vector directly.") +Standard_HEADER_DEPRECATED( + "BinLDrivers_VectorOfDocumentSection.hxx is deprecated since OCCT " + "8.0.0. Use NCollection_DynamicArray directly.") Standard_DEPRECATED("BinLDrivers_VectorOfDocumentSection is deprecated, use " - "NCollection_Vector directly") -typedef NCollection_Vector BinLDrivers_VectorOfDocumentSection; + "NCollection_DynamicArray directly") +typedef NCollection_DynamicArray BinLDrivers_VectorOfDocumentSection; #endif // _BinLDrivers_VectorOfDocumentSection_hxx diff --git a/src/Deprecated/NCollectionAliases/GeomInt_VectorOfReal.hxx b/src/Deprecated/NCollectionAliases/GeomInt_VectorOfReal.hxx index a356c02458..747e5307ca 100644 --- a/src/Deprecated/NCollectionAliases/GeomInt_VectorOfReal.hxx +++ b/src/Deprecated/NCollectionAliases/GeomInt_VectorOfReal.hxx @@ -14,18 +14,19 @@ //! @file GeomInt_VectorOfReal.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _GeomInt_VectorOfReal_hxx #define _GeomInt_VectorOfReal_hxx #include -#include +#include Standard_HEADER_DEPRECATED("GeomInt_VectorOfReal.hxx is deprecated since OCCT 8.0.0. Use " - "NCollection_Vector directly.") + "NCollection_DynamicArray directly.") - Standard_DEPRECATED("GeomInt_VectorOfReal is deprecated, use NCollection_Vector directly") -typedef NCollection_Vector GeomInt_VectorOfReal; + Standard_DEPRECATED( + "GeomInt_VectorOfReal is deprecated, use NCollection_DynamicArray directly") +typedef NCollection_DynamicArray GeomInt_VectorOfReal; #endif // _GeomInt_VectorOfReal_hxx diff --git a/src/Deprecated/NCollectionAliases/Interface_VectorOfFileParameter.hxx b/src/Deprecated/NCollectionAliases/Interface_VectorOfFileParameter.hxx index d757267171..72b16d718c 100644 --- a/src/Deprecated/NCollectionAliases/Interface_VectorOfFileParameter.hxx +++ b/src/Deprecated/NCollectionAliases/Interface_VectorOfFileParameter.hxx @@ -14,20 +14,20 @@ //! @file Interface_VectorOfFileParameter.hxx //! @brief Deprecated typedef for backward compatibility. //! @deprecated This header is deprecated since OCCT 8.0.0. -//! Use NCollection_Vector directly instead. +//! Use NCollection_DynamicArray directly instead. #ifndef _Interface_VectorOfFileParameter_hxx #define _Interface_VectorOfFileParameter_hxx #include -#include +#include #include Standard_HEADER_DEPRECATED("Interface_VectorOfFileParameter.hxx is deprecated since OCCT 8.0.0. " - "Use NCollection_Vector directly.") + "Use NCollection_DynamicArray directly.") Standard_DEPRECATED("Interface_VectorOfFileParameter is deprecated, use " - "NCollection_Vector directly") -typedef NCollection_Vector Interface_VectorOfFileParameter; + "NCollection_DynamicArray directly") +typedef NCollection_DynamicArray Interface_VectorOfFileParameter; #endif // _Interface_VectorOfFileParameter_hxx diff --git a/src/Draw/TKDraw/DBRep/DBRep.cxx b/src/Draw/TKDraw/DBRep/DBRep.cxx index a9344ae3dd..c8a6ed5370 100644 --- a/src/Draw/TKDraw/DBRep/DBRep.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -1370,7 +1370,7 @@ static int normals(Draw_Interpretor& theDI, int theArgNum, const char** theArgs) DBRep_WriteColorOrientation(); - NCollection_DataMap>> aNormals; + NCollection_DataMap>> aNormals; if (toUseMesh) { DBRep_DrawableShape::addMeshNormals(aNormals, aShape, aLength); @@ -1380,7 +1380,8 @@ static int normals(Draw_Interpretor& theDI, int theArgNum, const char** theArgs) DBRep_DrawableShape::addSurfaceNormals(aNormals, aShape, aLength, aNbAlongU, aNbAlongV); } - for (NCollection_DataMap>>::Iterator + for (NCollection_DataMap>>::Iterator aFaceIt(aNormals); aFaceIt.More(); aFaceIt.Next()) @@ -1391,7 +1392,7 @@ static int normals(Draw_Interpretor& theDI, int theArgNum, const char** theArgs) if (aFaceOri == TopAbs_REVERSED) bReverse = true; - for (NCollection_Vector>::Iterator aNormalsIt(aFaceIt.Value()); + for (NCollection_DynamicArray>::Iterator aNormalsIt(aFaceIt.Value()); aNormalsIt.More(); aNormalsIt.Next()) { diff --git a/src/Draw/TKDraw/DBRep/DBRep_Debug.cxx b/src/Draw/TKDraw/DBRep/DBRep_Debug.cxx index eb72a6b901..92ad84cfcf 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_Debug.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep_Debug.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include // This file defines global functions not declared in any public header, @@ -89,7 +89,7 @@ Standard_EXPORT const char* DBRep_SetComp(const char* theNameStr, void* theListP aC) || fromContainer>(theListPtr, aC) || fromContainer>(theListPtr, aC) - || fromContainer>(theListPtr, aC)) + || fromContainer>(theListPtr, aC)) { DBRep::Set(theNameStr, aC); return theNameStr; diff --git a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx index 3ec36e9cd5..17b2828cc3 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx @@ -1144,8 +1144,8 @@ void DBRep_DrawableShape::display(const occ::handle& T, } // allocate the arrays - NCollection_Array1 Free(1, std::max(1, 2 * nFree)); - NCollection_Vector> anInternal; + NCollection_Array1 Free(1, std::max(1, 2 * nFree)); + NCollection_DynamicArray> anInternal; int fr = 1; @@ -1185,7 +1185,7 @@ void DBRep_DrawableShape::display(const occ::handle& T, // internal edges dis.SetColor(Draw_bleu); - for (NCollection_Vector>::Iterator anInterIter(anInternal); + for (NCollection_DynamicArray>::Iterator anInterIter(anInternal); anInterIter.More(); anInterIter.Next()) { @@ -1197,9 +1197,10 @@ void DBRep_DrawableShape::display(const occ::handle& T, //================================================================================================= -bool DBRep_DrawableShape::addMeshNormals(NCollection_Vector>& theNormals, - const TopoDS_Face& theFace, - const double theLength) +bool DBRep_DrawableShape::addMeshNormals( + NCollection_DynamicArray>& theNormals, + const TopoDS_Face& theFace, + const double theLength) { TopLoc_Location aLoc; const occ::handle& aTriangulation = BRep_Tool::Triangulation(theFace, aLoc); @@ -1253,18 +1254,19 @@ bool DBRep_DrawableShape::addMeshNormals(NCollection_Vector>>& theNormals, - const TopoDS_Shape& theShape, - const double theLength) + NCollection_DataMap>>& theNormals, + const TopoDS_Shape& theShape, + const double theLength) { TopLoc_Location aLoc; for (TopExp_Explorer aFaceIt(theShape, TopAbs_FACE); aFaceIt.More(); aFaceIt.Next()) { - const TopoDS_Face& aFace = TopoDS::Face(aFaceIt.Current()); - NCollection_Vector>* aFaceNormals = theNormals.ChangeSeek(aFace); + const TopoDS_Face& aFace = TopoDS::Face(aFaceIt.Current()); + NCollection_DynamicArray>* aFaceNormals = + theNormals.ChangeSeek(aFace); if (aFaceNormals == nullptr) { - aFaceNormals = theNormals.Bound(aFace, NCollection_Vector>()); + aFaceNormals = theNormals.Bound(aFace, NCollection_DynamicArray>()); } addMeshNormals(*aFaceNormals, aFace, theLength); @@ -1274,11 +1276,11 @@ void DBRep_DrawableShape::addMeshNormals( //================================================================================================= bool DBRep_DrawableShape::addSurfaceNormals( - NCollection_Vector>& theNormals, - const TopoDS_Face& theFace, - const double theLength, - const int theNbAlongU, - const int theNbAlongV) + NCollection_DynamicArray>& theNormals, + const TopoDS_Face& theFace, + const double theLength, + const int theNbAlongU, + const int theNbAlongV) { { TopLoc_Location aLoc; @@ -1330,19 +1332,20 @@ bool DBRep_DrawableShape::addSurfaceNormals( //================================================================================================= void DBRep_DrawableShape::addSurfaceNormals( - NCollection_DataMap>>& theNormals, - const TopoDS_Shape& theShape, - const double theLength, - const int theNbAlongU, - const int theNbAlongV) + NCollection_DataMap>>& theNormals, + const TopoDS_Shape& theShape, + const double theLength, + const int theNbAlongU, + const int theNbAlongV) { for (TopExp_Explorer aFaceIt(theShape, TopAbs_FACE); aFaceIt.More(); aFaceIt.Next()) { - const TopoDS_Face& aFace = TopoDS::Face(aFaceIt.Current()); - NCollection_Vector>* aFaceNormals = theNormals.ChangeSeek(aFace); + const TopoDS_Face& aFace = TopoDS::Face(aFaceIt.Current()); + NCollection_DynamicArray>* aFaceNormals = + theNormals.ChangeSeek(aFace); if (aFaceNormals == nullptr) { - aFaceNormals = theNormals.Bound(aFace, NCollection_Vector>()); + aFaceNormals = theNormals.Bound(aFace, NCollection_DynamicArray>()); } addSurfaceNormals(*aFaceNormals, aFace, theLength, theNbAlongU, theNbAlongV); } diff --git a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.hxx b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.hxx index c4afc4cc04..d398fdc2e8 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.hxx +++ b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.hxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -120,18 +120,19 @@ public: //! @param[in] theLength normal length //! @return FALSE if normals can not be computed Standard_EXPORT static bool addMeshNormals( - NCollection_Vector>& theNormals, - const TopoDS_Face& theFace, - const double theLength); + NCollection_DynamicArray>& theNormals, + const TopoDS_Face& theFace, + const double theLength); //! Auxiliary method computing nodal normals for presentation purposes. //! @param[out] theNormals map of computed normals (grouped per Face) //! @param[in] theShape input shape which will be exploded into Faces //! @param[in] theLength normal length Standard_EXPORT static void addMeshNormals( - NCollection_DataMap>>& theNormals, - const TopoDS_Shape& theShape, - const double theLength); + NCollection_DataMap>>& + theNormals, + const TopoDS_Shape& theShape, + const double theLength); //! Auxiliary method computing surface normals distributed within the Face for presentation //! purposes. @@ -142,11 +143,11 @@ public: //! @param[in] theNbAlongV number along V //! @return FALSE if normals can not be computed Standard_EXPORT static bool addSurfaceNormals( - NCollection_Vector>& theNormals, - const TopoDS_Face& theFace, - const double theLength, - const int theNbAlongU, - const int theNbAlongV); + NCollection_DynamicArray>& theNormals, + const TopoDS_Face& theFace, + const double theLength, + const int theNbAlongU, + const int theNbAlongV); //! Auxiliary method computing surface normals distributed within the Face for presentation //! purposes. @@ -157,11 +158,12 @@ public: //! @param[in] theNbAlongV number along V //! @return FALSE if normals can not be computed Standard_EXPORT static void addSurfaceNormals( - NCollection_DataMap>>& theNormals, - const TopoDS_Shape& theShape, - const double theLength, - const int theNbAlongU, - const int theNbAlongV); + NCollection_DataMap>>& + theNormals, + const TopoDS_Shape& theShape, + const double theLength, + const int theNbAlongU, + const int theNbAlongV); private: void display(const occ::handle& T, diff --git a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx index 211217ac89..3a401fc206 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include @@ -2856,8 +2856,8 @@ static int OCC7639(Draw_Interpretor& di, int argc, const char** argv) return 1; } - int i, aValue, aPosition; - NCollection_Vector vec; + int i, aValue, aPosition; + NCollection_DynamicArray vec; for (i = 0; i < argc - 1; i++) { i++; @@ -2865,8 +2865,8 @@ static int OCC7639(Draw_Interpretor& di, int argc, const char** argv) aPosition = Draw::Atoi(argv[i + 1]); vec.SetValue(aValue, aPosition); } - NCollection_Vector::Iterator it(vec); - int j; + NCollection_DynamicArray::Iterator it(vec); + int j; for (j = 0; it.More(); it.Next(), j++) { // di << it.Value() << "\n"; diff --git a/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx b/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx index c479d22fbc..0bb86389ae 100644 --- a/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx +++ b/src/Draw/TKTopTest/BOPTest/BOPTest_DebugCommands.cxx @@ -47,13 +47,14 @@ static void GetTypeByName(const char* theName, TopAbs_ShapeEnum& theType); static void GetNameByType(const TopAbs_ShapeEnum& theType, char* theName); template -static void DumpInterfs(const NCollection_Vector& theVInterf, Draw_Interpretor& di); +static void DumpInterfs(const NCollection_DynamicArray& theVInterf, + Draw_Interpretor& di); template -static void SearchNewIndex(const char* theCType, - const int theInd, - const NCollection_Vector& theVInterf, - Draw_Interpretor& di); +static void SearchNewIndex(const char* theCType, + const int theInd, + const NCollection_DynamicArray& theVInterf, + Draw_Interpretor& di); static int bopfinfo(Draw_Interpretor& di, int n, const char** a, const int iPriz); // commands @@ -453,11 +454,11 @@ int bopwho(Draw_Interpretor& di, int n, const char** a) return 0; } // search among interfs - NCollection_Vector& aVVs = pDS->InterfVV(); - NCollection_Vector& aVEs = pDS->InterfVE(); - NCollection_Vector& aEEs = pDS->InterfEE(); - NCollection_Vector& aVFs = pDS->InterfVF(); - NCollection_Vector& aEFs = pDS->InterfEF(); + NCollection_DynamicArray& aVVs = pDS->InterfVV(); + NCollection_DynamicArray& aVEs = pDS->InterfVE(); + NCollection_DynamicArray& aEEs = pDS->InterfEE(); + NCollection_DynamicArray& aVFs = pDS->InterfVF(); + NCollection_DynamicArray& aEFs = pDS->InterfEF(); // SearchNewIndex("V/V: ", ind, aVVs, di); SearchNewIndex("V/E: ", ind, aVEs, di); @@ -471,16 +472,16 @@ int bopwho(Draw_Interpretor& di, int n, const char** a) int i, n1, n2, k, aNb, aNbC, aNbP, nV1, nV2; NCollection_List>::Iterator aItLPB; // - bFound = false; - NCollection_Vector& aFFs = pDS->InterfFF(); - aNb = aFFs.Length(); + bFound = false; + NCollection_DynamicArray& aFFs = pDS->InterfFF(); + aNb = aFFs.Length(); for (i = 0; i < aNb; ++i) { const BOPDS_InterfFF& anInt = aFFs(i); anInt.Indices(n1, n2); // - const NCollection_Vector& aVNC = anInt.Curves(); - aNbC = aVNC.Length(); + const NCollection_DynamicArray& aVNC = anInt.Curves(); + aNbC = aVNC.Length(); for (k = 0; k < aNbC; ++k) { const BOPDS_Curve& aNC = aVNC(k); @@ -508,9 +509,9 @@ int bopwho(Draw_Interpretor& di, int n, const char** a) di << "\n"; } // - bFound = false; - const NCollection_Vector& aVNP = anInt.Points(); - aNbP = aVNP.Length(); + bFound = false; + const NCollection_DynamicArray& aVNP = anInt.Points(); + aNbP = aVNP.Length(); for (k = 0; k < aNbP; ++k) { const BOPDS_Point& aNP = aVNP(k); @@ -718,7 +719,7 @@ int bopsc(Draw_Interpretor& di, int n, const char** a) if (n > 2) nSF2 = Draw::Atoi(a[2]); - NCollection_Vector& aFFs = pDS->InterfFF(); + NCollection_DynamicArray& aFFs = pDS->InterfFF(); // iCnt = 0; iPriz = 0; @@ -742,9 +743,9 @@ int bopsc(Draw_Interpretor& di, int n, const char** a) // aFF.Indices(nF1, nF2); // - iX = 0; - const NCollection_Vector& aVNC = aFF.Curves(); - aNbC = aVNC.Length(); + iX = 0; + const NCollection_DynamicArray& aVNC = aFF.Curves(); + aNbC = aVNC.Length(); for (k = 0; k < aNbC; ++k) { const BOPDS_Curve& aNC = aVNC(k); @@ -780,9 +781,9 @@ int bopsc(Draw_Interpretor& di, int n, const char** a) di << "\n"; } // - iX = 0; - const NCollection_Vector& aVNP = aFF.Points(); - aNbP = aVNP.Length(); + iX = 0; + const NCollection_DynamicArray& aVNP = aFF.Points(); + aNbP = aVNP.Length(); for (k = 0; k < aNbP; ++k) { const BOPDS_Point& aNP = aVNP(k); @@ -1631,7 +1632,7 @@ void GetNameByType(const TopAbs_ShapeEnum& theType, char* theName) //================================================================================================= template -void DumpInterfs(const NCollection_Vector& theVInterf, Draw_Interpretor& di) +void DumpInterfs(const NCollection_DynamicArray& theVInterf, Draw_Interpretor& di) { int i, aNb, n1, n2, nNew; char buf[64]; @@ -1664,10 +1665,10 @@ void DumpInterfs(const NCollection_Vector& theVInterf, Draw_Interpre //================================================================================================= template -void SearchNewIndex(const char* theCType, - const int theInd, - const NCollection_Vector& theVInterf, - Draw_Interpretor& di) +void SearchNewIndex(const char* theCType, + const int theInd, + const NCollection_DynamicArray& theVInterf, + Draw_Interpretor& di) { char buf[64]; bool bFound; diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_APICommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_APICommands.cxx index 457f6070e8..aa9af47642 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_APICommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_APICommands.cxx @@ -508,8 +508,8 @@ static int extrema(Draw_Interpretor& di, int n, const char** a) U2l = GC2->LastParameter(); } - NCollection_Vector aPnts1, aPnts2; - NCollection_Vector aPrms[4]; + NCollection_DynamicArray aPnts1, aPnts2; + NCollection_DynamicArray aPrms[4]; if (!GC1.IsNull() && !GC2.IsNull()) { GeomAPI_ExtremaCurveCurve Ex(GC1, GC2, U1f, U1l, U2f, U2l); diff --git a/src/Draw/TKTopTest/MeshTest/MeshTest.cxx b/src/Draw/TKTopTest/MeshTest/MeshTest.cxx index 894ac2f1ef..6ed25632dc 100644 --- a/src/Draw/TKTopTest/MeshTest/MeshTest.cxx +++ b/src/Draw/TKTopTest/MeshTest/MeshTest.cxx @@ -743,7 +743,7 @@ static int trianglesinfo(Draw_Interpretor& theDI, int theNbArgs, const char** th double aMaxDeflection = 0.0, aMeshingDefl = -1.0, aMeshingAngDefl = -1.0, aMeshingMinSize = -1.0; int aNbFaces = 0, aNbEmptyFaces = 0, aNbTriangles = 0, aNbNodes = 0, aNbRepresentations = 0; NCollection_IndexedDataMap aLODsStat; - NCollection_Vector aNbLODs; + NCollection_DynamicArray aNbLODs; for (anExp.Init(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) { TopoDS_Face aFace = TopoDS::Face(anExp.Current()); @@ -878,7 +878,7 @@ static int trianglesinfo(Draw_Interpretor& theDI, int theNbArgs, const char** th std::sort(aNbLODs.begin(), aNbLODs.end()); } NCollection_IndexedMap aLODsRange; - for (NCollection_Vector::Iterator aNbIter(aNbLODs); aNbIter.More(); aNbIter.Next()) + for (NCollection_DynamicArray::Iterator aNbIter(aNbLODs); aNbIter.More(); aNbIter.Next()) { if (!aLODsRange.Contains(aNbIter.Value())) { diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest.cxx index 145256e8e9..5cd08c89ba 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest.cxx @@ -4096,10 +4096,10 @@ int VTexture(Draw_Interpretor& theDi, int theArgsNb, const char** theArgVec) Graphic3d_TypeOfTextureFilter aFilter = Graphic3d_TOTF_NEAREST; Graphic3d_LevelOfTextureAnisotropy anAnisoFilter = Graphic3d_LOTA_OFF; - occ::handle aTexturedIO; - occ::handle aTexturedShape; - occ::handle aTextureSetOld; - NCollection_Vector> aTextureVecNew; + occ::handle aTexturedIO; + occ::handle aTexturedShape; + occ::handle aTextureSetOld; + NCollection_DynamicArray> aTextureVecNew; bool toSetGenRepeat = false, toSetGenScale = false, toSetGenOrigin = false, toSetImage = false, toComputeUV = false; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx index 1910b768d0..da2ec0dbda 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -6553,7 +6553,8 @@ protected: { AIS_Shape::Compute(thePrsMgr, thePrs, theMode); - NCollection_DataMap>> aNormalMap; + NCollection_DataMap>> + aNormalMap; if (ToUseMesh) { DBRep_DrawableShape::addMeshNormals(aNormalMap, myshape, NormalLength); @@ -6568,7 +6569,8 @@ protected: const double aArrowAngle = myDrawer->ArrowAspect()->Angle(); const double aArrowLength = myDrawer->ArrowAspect()->Length(); - for (NCollection_DataMap>>::Iterator + for (NCollection_DataMap>>::Iterator aFaceIt(aNormalMap); aFaceIt.More(); aFaceIt.Next()) @@ -6576,7 +6578,7 @@ protected: const bool toReverse = ToOrient && aFaceIt.Key().Orientation() == TopAbs_REVERSED; occ::handle aSegments = new Graphic3d_ArrayOfSegments(2 * aFaceIt.Value().Length()); - for (NCollection_Vector>::Iterator aPntIt(aFaceIt.Value()); + for (NCollection_DynamicArray>::Iterator aPntIt(aFaceIt.Value()); aPntIt.More(); aPntIt.Next()) { diff --git a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx index 98c6b64f55..82fbc5a462 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx @@ -239,7 +239,7 @@ BVH_Tree* BVH_Tree::CollapseToQuadTree } else { - NCollection_Vector aGrandChildNodes; + NCollection_DynamicArray aGrandChildNodes; const int aLftChild = Child<0>(std::get<0>(aNode)); const int aRghChild = Child<1>(std::get<0>(aNode)); diff --git a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx index 08bb94dacd..a2ed702d31 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx @@ -17,7 +17,7 @@ #define _BVH_LinearBuilder_Header #include -#include +#include #include //! Performs fast BVH construction using LBVH building approach. @@ -236,7 +236,7 @@ public: const int aLftChild = theData.myBVH->NodeInfoBuffer()[theData.myNode].y(); const int aRghChild = theData.myBVH->NodeInfoBuffer()[theData.myNode].z(); - NCollection_Vector> aList(2); + NCollection_DynamicArray> aList(2); if (!theData.myBVH->IsOuter(aLftChild)) { BoundData aBoundData = {theData.mySet, diff --git a/src/FoundationClasses/TKMath/BVH/BVH_ObjectSet.hxx b/src/FoundationClasses/TKMath/BVH/BVH_ObjectSet.hxx index 66fd4cb758..80d4f5771d 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_ObjectSet.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_ObjectSet.hxx @@ -27,7 +27,7 @@ class BVH_ObjectSet : public BVH_Set { public: //! Type of array of geometric objects. - typedef NCollection_Vector>> BVH_ObjectList; + typedef NCollection_DynamicArray>> BVH_ObjectList; public: //! Creates new set of geometric objects. diff --git a/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx index 1560273b62..6d82fa84e5 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include #include @@ -240,7 +240,7 @@ void BVH_QueueBuilder::Build(BVH_Set* theSet, // Reserve the maximum possible number of nodes in the BVH theBVH->Reserve(2 * aSetSize - 1); - NCollection_Vector> aThreads; + NCollection_DynamicArray> aThreads; // Run BVH build threads for (int aThreadIndex = 0; aThreadIndex < myNumOfThreads; ++aThreadIndex) diff --git a/src/FoundationClasses/TKMath/BVH/BVH_Types.hxx b/src/FoundationClasses/TKMath/BVH/BVH_Types.hxx index fdabeedd39..cd6f6d7d86 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_Types.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_Types.hxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -117,7 +117,7 @@ template struct ArrayType { #ifndef _BVH_USE_STD_VECTOR_ - typedef NCollection_Vector::Type> Type; + typedef NCollection_DynamicArray::Type> Type; #else typedef std::vector::Type> Type; #endif diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.cxx index 3092da08f4..83076b8db6 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.cxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -131,7 +131,7 @@ public: DEFINE_STANDARD_RTTIEXT(Bnd_VoxelGrid, Standard_Transient) public: - using VectorInt = NCollection_Vector; + using VectorInt = NCollection_DynamicArray; private: using SliceArray = NCollection_Array1; diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.hxx index 64c999f3ec..69dc604705 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_BoundSortBox.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ public: DEFINE_STANDARD_ALLOC private: - using VectorInt = NCollection_Vector; + using VectorInt = NCollection_DynamicArray; public: //! Constructs an empty comparison algorithm for bounding boxes. diff --git a/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.cxx b/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.cxx index b1ba6eadb3..3f8c6097d2 100644 --- a/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.cxx +++ b/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.cxx @@ -125,13 +125,13 @@ CSLib_Class2d::CSLib_Class2d(const NCollection_Sequence& thePnts2d, //================================================================================================= -CSLib_Class2d::CSLib_Class2d(const NCollection_Vector& thePnts2d, - const double theTolU, - const double theTolV, - const double theUMin, - const double theVMin, - const double theUMax, - const double theVMax) +CSLib_Class2d::CSLib_Class2d(const NCollection_DynamicArray& thePnts2d, + const double theTolU, + const double theTolV, + const double theUMin, + const double theVMin, + const double theUMax, + const double theVMax) { init(thePnts2d, theTolU, theTolV, theUMin, theVMin, theUMax, theVMax); } diff --git a/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.hxx b/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.hxx index d9f2a2fe47..8e8d8d2ef4 100644 --- a/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.hxx +++ b/src/FoundationClasses/TKMath/CSLib/CSLib_Class2d.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include class gp_Pnt2d; @@ -102,13 +102,13 @@ public: //! @param[in] theVMin Minimum V bound of the polygon domain //! @param[in] theUMax Maximum U bound of the polygon domain //! @param[in] theVMax Maximum V bound of the polygon domain - Standard_EXPORT CSLib_Class2d(const NCollection_Vector& thePnts2d, - double theTolU, - double theTolV, - double theUMin, - double theVMin, - double theUMax, - double theVMax); + Standard_EXPORT CSLib_Class2d(const NCollection_DynamicArray& thePnts2d, + double theTolU, + double theTolV, + double theUMin, + double theVMin, + double theUMax, + double theVMax); //! Move constructor. CSLib_Class2d(CSLib_Class2d&& theOther) noexcept diff --git a/src/FoundationClasses/TKMath/GTests/MathOpt_GlobOpt_Test.cxx b/src/FoundationClasses/TKMath/GTests/MathOpt_GlobOpt_Test.cxx index a4951689ee..3132a3aee3 100644 --- a/src/FoundationClasses/TKMath/GTests/MathOpt_GlobOpt_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/MathOpt_GlobOpt_Test.cxx @@ -553,7 +553,7 @@ TEST(MathOpt_GlobOptTest, GlobalMinimum_PSOHybrid_WithSeeds) math_Vector aSeedPos(1, 2); aSeedPos(1) = 1.5; aSeedPos(2) = 2.5; - NCollection_Vector aSeeds; + NCollection_DynamicArray aSeeds; aSeeds.Append(MathOpt::PSOSeedParticle(aSeedPos)); MathOpt::PSOStats aStats; diff --git a/src/FoundationClasses/TKMath/GTests/MathOpt_PSO_Test.cxx b/src/FoundationClasses/TKMath/GTests/MathOpt_PSO_Test.cxx index f0c9533d6c..02c5c369ef 100644 --- a/src/FoundationClasses/TKMath/GTests/MathOpt_PSO_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/MathOpt_PSO_Test.cxx @@ -473,7 +473,7 @@ TEST(MathOpt_PSOTest, SeededInit_Sphere2D_ImprovesEvalCount) math_Vector aSeedPos(1, 2, 0.0); aSeedPos(1) = 0.1; aSeedPos(2) = -0.1; - NCollection_Vector aSeeds; + NCollection_DynamicArray aSeeds; aSeeds.Append(MathOpt::PSOSeedParticle(aSeedPos)); MathOpt::PSOStats aStatsSeeded; @@ -501,8 +501,8 @@ TEST(MathOpt_PSOTest, SeededInit_Rastrigin2D_StableQuality) aConfig.InitMode = MathOpt::PSOInitMode::SeededPlusRandom; // Seed near global minimum - math_Vector aSeedPos(1, 2, 0.0); - NCollection_Vector aSeeds; + math_Vector aSeedPos(1, 2, 0.0); + NCollection_DynamicArray aSeeds; aSeeds.Append(MathOpt::PSOSeedParticle(aSeedPos, 0.0)); auto aResult = MathOpt::PSO(aFunc, aLower, aUpper, aConfig, &aSeeds); @@ -741,8 +741,8 @@ TEST(MathOpt_PSOTest, ClampedSeed_ReEvaluates_StaleValue) aSeedPos(2) = -10.0; // out of bounds (will be clamped to -5.0) // Provide a stale value of 0.0 which is wrong for (5, -5) - NCollection_Vector aSeeds; - MathOpt::PSOSeedParticle aSeed(aSeedPos, 0.0); + NCollection_DynamicArray aSeeds; + MathOpt::PSOSeedParticle aSeed(aSeedPos, 0.0); aSeeds.Append(aSeed); auto aResult = MathOpt::PSO(aFunc, aLower, aUpper, aConfig, &aSeeds); diff --git a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Kronrod.hxx b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Kronrod.hxx index 012ff9b8ae..6a56c96247 100644 --- a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Kronrod.hxx +++ b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Kronrod.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include @@ -222,7 +222,7 @@ IntegResult Kronrod(Function& theFunc, return anInitResult; } - NCollection_Vector aHeap; + NCollection_DynamicArray aHeap; aHeap.Append({theLower, theUpper, *anInitResult.Value, *anInitResult.AbsoluteError}); double aTotalValue = *anInitResult.Value; diff --git a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Multiple.hxx b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Multiple.hxx index f03b3fb965..5fe755e59d 100644 --- a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Multiple.hxx +++ b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Multiple.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -97,9 +97,9 @@ IntegResult GaussMultiple(Func& theFunc, } // Get Gauss points and weights for each variable - // Use NCollection_Vector since math_Vector has no default constructor - NCollection_Vector aGaussPoints; - NCollection_Vector aGaussWeights; + // Use NCollection_DynamicArray since math_Vector has no default constructor + NCollection_DynamicArray aGaussPoints; + NCollection_DynamicArray aGaussWeights; for (int i = 0; i < theNVars; ++i) { diff --git a/src/FoundationClasses/TKMath/MathOpt/MathOpt_BFGS.hxx b/src/FoundationClasses/TKMath/MathOpt/MathOpt_BFGS.hxx index 8621431503..2559674595 100644 --- a/src/FoundationClasses/TKMath/MathOpt/MathOpt_BFGS.hxx +++ b/src/FoundationClasses/TKMath/MathOpt/MathOpt_BFGS.hxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -365,9 +365,9 @@ VectorResult LBFGS(Function& theFunc, } // Storage for {s, y} pairs (circular buffer) - NCollection_Vector aSVec; - NCollection_Vector aYVec; - math_Vector aRhoVec(0, aM - 1, 0.0); + NCollection_DynamicArray aSVec; + NCollection_DynamicArray aYVec; + math_Vector aRhoVec(0, aM - 1, 0.0); for (int i = 0; i < aM; ++i) { aSVec.Append(math_Vector(1, aN)); diff --git a/src/FoundationClasses/TKMath/MathOpt/MathOpt_GlobOpt.hxx b/src/FoundationClasses/TKMath/MathOpt/MathOpt_GlobOpt.hxx index 59e8c699b3..b7ca1737f1 100644 --- a/src/FoundationClasses/TKMath/MathOpt/MathOpt_GlobOpt.hxx +++ b/src/FoundationClasses/TKMath/MathOpt/MathOpt_GlobOpt.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -109,8 +109,8 @@ VectorResult DifferentialEvolution(Function& theFunc, MathUtils::RandomGenerator aRNG(theConfig.Seed); // Population: vector of candidate solutions - NCollection_Vector aPopulation; - math_Vector aFitness(0, aNbPop - 1); + NCollection_DynamicArray aPopulation; + math_Vector aFitness(0, aNbPop - 1); // Initialize population for (int aMemberIdx = 0; aMemberIdx < aNbPop; ++aMemberIdx) @@ -390,13 +390,13 @@ VectorResult GlobalMinimum(Function& theFunc, //! @param theStats optional PSO statistics output //! @return result containing best solution found template -VectorResult GlobalMinimum(Function& theFunc, - const math_Vector& theLowerBounds, - const math_Vector& theUpperBounds, - const GlobalConfig& theConfig, - const PSOConfig* thePSOConfig, - const NCollection_Vector* theSeeds = nullptr, - PSOStats* theStats = nullptr) +VectorResult GlobalMinimum(Function& theFunc, + const math_Vector& theLowerBounds, + const math_Vector& theUpperBounds, + const GlobalConfig& theConfig, + const PSOConfig* thePSOConfig, + const NCollection_DynamicArray* theSeeds = nullptr, + PSOStats* theStats = nullptr) { switch (theConfig.Strategy) { diff --git a/src/FoundationClasses/TKMath/MathOpt/MathOpt_PSO.hxx b/src/FoundationClasses/TKMath/MathOpt/MathOpt_PSO.hxx index 61eaaa6e30..55f981b25a 100644 --- a/src/FoundationClasses/TKMath/MathOpt/MathOpt_PSO.hxx +++ b/src/FoundationClasses/TKMath/MathOpt/MathOpt_PSO.hxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -224,12 +224,12 @@ void PolishCoordinateWise(Function& theFunc, //! @param theStats optional output statistics //! @return result containing best solution found template -VectorResult PSO(Function& theFunc, - const math_Vector& theLowerBounds, - const math_Vector& theUpperBounds, - const PSOConfig& theConfig, - const NCollection_Vector* theSeeds, - PSOStats* theStats = nullptr) +VectorResult PSO(Function& theFunc, + const math_Vector& theLowerBounds, + const math_Vector& theUpperBounds, + const PSOConfig& theConfig, + const NCollection_DynamicArray* theSeeds, + PSOStats* theStats = nullptr) { VectorResult aResult; @@ -283,7 +283,7 @@ VectorResult PSO(Function& theFunc, } }; - NCollection_Vector aSwarm; + NCollection_DynamicArray aSwarm; for (int aPartIdx = 0; aPartIdx < aNbParticles; ++aPartIdx) { aSwarm.Append(Particle(aLower, aUpper)); @@ -619,7 +619,7 @@ VectorResult PSO(Function& theFunc, // Sort by fitness descending (simple selection of worst) // Reinitialize aNbRestart worst particles - NCollection_Vector aWorstIndices; + NCollection_DynamicArray aWorstIndices; for (int aCollIdx = 0; aCollIdx < aNbParticles; ++aCollIdx) { if (aCollIdx != aBestIdx) diff --git a/src/FoundationClasses/TKMath/MathRoot/MathRoot_All.hxx b/src/FoundationClasses/TKMath/MathRoot/MathRoot_All.hxx index dedafddbb4..c216d550b6 100644 --- a/src/FoundationClasses/TKMath/MathRoot/MathRoot_All.hxx +++ b/src/FoundationClasses/TKMath/MathRoot/MathRoot_All.hxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include @@ -38,10 +38,10 @@ struct NullInterval //! Result for all roots finder including null intervals. struct AllRootsResult { - MathUtils::Status Status = MathUtils::Status::NotConverged; - NCollection_Vector Roots; //!< Isolated root locations - NCollection_Vector RootStates; //!< State numbers for roots - NCollection_Vector NullIntervals; //!< Intervals where function is null + MathUtils::Status Status = MathUtils::Status::NotConverged; + NCollection_DynamicArray Roots; //!< Isolated root locations + NCollection_DynamicArray RootStates; //!< State numbers for roots + NCollection_DynamicArray NullIntervals; //!< Intervals where function is null bool IsDone() const { return Status == MathUtils::Status::OK; } @@ -138,7 +138,7 @@ AllRootsResult FindAllRootsWithIntervals(Func& theFunc, double aDebNul = 0.0, aFinNul = 0.0; double aValSav = aPrevVal; - NCollection_Vector aIntervalStarts, aIntervalEnds; + NCollection_DynamicArray aIntervalStarts, aIntervalEnds; // Scan through samples to find null intervals for (int i = 1; i < aNbp; ++i) diff --git a/src/FoundationClasses/TKMath/MathRoot/MathRoot_MultipleUtils.hxx b/src/FoundationClasses/TKMath/MathRoot/MathRoot_MultipleUtils.hxx index db548b30bf..74b0dcd984 100644 --- a/src/FoundationClasses/TKMath/MathRoot/MathRoot_MultipleUtils.hxx +++ b/src/FoundationClasses/TKMath/MathRoot/MathRoot_MultipleUtils.hxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -42,11 +42,11 @@ using namespace MathUtils; //! Contains all found roots sorted in ascending order. struct MultipleResult { - MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status - size_t NbIterations = 0; //!< Total iterations across all roots - NCollection_Vector Roots; //!< Found roots (sorted) - NCollection_Vector Values; //!< Function values at roots - bool IsAllNull = false; //!< True if function is essentially zero in range + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + size_t NbIterations = 0; //!< Total iterations across all roots + NCollection_DynamicArray Roots; //!< Found roots (sorted) + NCollection_DynamicArray Values; //!< Function values at roots + bool IsAllNull = false; //!< True if function is essentially zero in range //! Returns true if computation succeeded. bool IsDone() const { return Status == MathUtils::Status::OK; } diff --git a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx index 3b0c88f3da..a89c9a7080 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.cxx @@ -90,7 +90,7 @@ Poly_CoherentTriangulation::Poly_CoherentTriangulation( Poly_CoherentTriangulation::~Poly_CoherentTriangulation() { - NCollection_Vector::Iterator anIter(myNodes); + NCollection_DynamicArray::Iterator anIter(myNodes); for (; anIter.More(); anIter.Next()) { anIter.ChangeValue().Clear(myAlloc); @@ -110,8 +110,8 @@ occ::handle Poly_CoherentTriangulation::GetTriangulation() c occ::handle aResult = new Poly_Triangulation(nNodes, nTriangles, false); - NCollection_Vector vecNodeId; - int aCount = 0; + NCollection_DynamicArray vecNodeId; + int aCount = 0; // Copy the nodes (3D and 2D coordinates) for (int i = 0; i < myNodes.Length(); i++) @@ -141,7 +141,8 @@ occ::handle Poly_CoherentTriangulation::GetTriangulation() c // Copy the triangles aCount = 0; - for (NCollection_Vector::Iterator anIterT(myTriangles); anIterT.More(); + for (NCollection_DynamicArray::Iterator anIterT(myTriangles); + anIterT.More(); anIterT.Next()) { const Poly_CoherentTriangle& aTri = anIterT.Value(); @@ -188,7 +189,7 @@ bool Poly_CoherentTriangulation::RemoveDegenerated( if (pLstRemovedNode) pLstRemovedNode->Clear(); - // NCollection_Vector::Iterator anIterT(myTriangles); + // NCollection_DynamicArray::Iterator anIterT(myTriangles); Poly_CoherentTriangulation::IteratorOfTriangle anIterT(this); for (; anIterT.More(); anIterT.Next()) { @@ -266,7 +267,7 @@ Poly_CoherentTriangulation::IteratorOfTriangle::IteratorOfTriangle( const Poly_CoherentTriangle& aTri = Value(); if (!aTri.IsEmpty()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } } @@ -275,13 +276,13 @@ Poly_CoherentTriangulation::IteratorOfTriangle::IteratorOfTriangle( void Poly_CoherentTriangulation::IteratorOfTriangle::Next() noexcept { - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); while (More()) { const Poly_CoherentTriangle& aTri = Value(); if (!aTri.IsEmpty()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } @@ -297,7 +298,7 @@ Poly_CoherentTriangulation::IteratorOfNode::IteratorOfNode( { if (!Value().IsFreeNode()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } } @@ -306,12 +307,12 @@ Poly_CoherentTriangulation::IteratorOfNode::IteratorOfNode( void Poly_CoherentTriangulation::IteratorOfNode::Next() noexcept { - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); while (More()) { if (!Value().IsFreeNode()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } @@ -327,7 +328,7 @@ Poly_CoherentTriangulation::IteratorOfLink::IteratorOfLink( { if (!Value().IsEmpty()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } } @@ -336,12 +337,12 @@ Poly_CoherentTriangulation::IteratorOfLink::IteratorOfLink( void Poly_CoherentTriangulation::IteratorOfLink::Next() noexcept { - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); while (More()) { if (!Value().IsEmpty()) break; - NCollection_Vector::Iterator::Next(); + NCollection_DynamicArray::Iterator::Next(); } } @@ -349,8 +350,8 @@ void Poly_CoherentTriangulation::IteratorOfLink::Next() noexcept int Poly_CoherentTriangulation::NNodes() const { - int aCount(0); - NCollection_Vector::Iterator anIter(myNodes); + int aCount(0); + NCollection_DynamicArray::Iterator anIter(myNodes); for (; anIter.More(); anIter.Next()) if (!anIter.Value().IsFreeNode()) aCount++; @@ -361,8 +362,8 @@ int Poly_CoherentTriangulation::NNodes() const int Poly_CoherentTriangulation::NTriangles() const { - int aCount(0); - NCollection_Vector::Iterator anIter(myTriangles); + int aCount(0); + NCollection_DynamicArray::Iterator anIter(myTriangles); for (; anIter.More(); anIter.Next()) { const Poly_CoherentTriangle& aTri = anIter.Value(); @@ -376,8 +377,8 @@ int Poly_CoherentTriangulation::NTriangles() const int Poly_CoherentTriangulation::NLinks() const { - int aCount(0); - NCollection_Vector::Iterator anIter(myLinks); + int aCount(0); + NCollection_DynamicArray::Iterator anIter(myLinks); for (; anIter.More(); anIter.Next()) { if (!anIter.Value().IsEmpty()) @@ -645,7 +646,7 @@ bool Poly_CoherentTriangulation::FindTriangle(const Poly_CoherentLink& theLi int Poly_CoherentTriangulation::ComputeLinks() { myLinks.Clear(); - NCollection_Vector::Iterator anIter(myTriangles); + NCollection_DynamicArray::Iterator anIter(myTriangles); for (; anIter.More(); anIter.Next()) { const Poly_CoherentTriangle& aTriangle = anIter.Value(); @@ -687,7 +688,7 @@ int Poly_CoherentTriangulation::ComputeLinks() void Poly_CoherentTriangulation::ClearLinks() { myLinks.Clear(); - NCollection_Vector::Iterator anIter(myTriangles); + NCollection_DynamicArray::Iterator anIter(myTriangles); for (; anIter.More(); anIter.Next()) { Poly_CoherentTriangle& aTriangle = anIter.ChangeValue(); diff --git a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.hxx b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.hxx index eb547b9026..742ebbbd55 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.hxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_CoherentTriangulation.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include class Poly_CoherentTriangulation; template @@ -89,12 +89,12 @@ class NCollection_List; * to Triangles and Links, you can subclass Poly_CoherentTriangulation and use the protected API for * your needs. * - * Memory management: All data objects are stored in NCollection_Vector containers that prove to be - * efficient for the performance. In addition references to triangles are stored in ring lists, with - * an instance of such list per Poly_CoherentNode. These lists are allocated in a memory allocator - * that is provided in the constructor of Poly_CoherentTriangulation. By default the standard OCCT - * allocator (aka NCollection_BaseAllocator) is used. But if you need to increase the performance - * you can use NCollection_IncAllocator instead. + * Memory management: All data objects are stored in NCollection_DynamicArray containers that prove + * to be efficient for the performance. In addition references to triangles are stored in ring + * lists, with an instance of such list per Poly_CoherentNode. These lists are allocated in a memory + * allocator that is provided in the constructor of Poly_CoherentTriangulation. By default the + * standard OCCT allocator (aka NCollection_BaseAllocator) is used. But if you need to increase the + * performance you can use NCollection_IncAllocator instead. * */ class Poly_CoherentTriangulation : public Standard_Transient @@ -104,7 +104,7 @@ public: * Subclass Iterator - allows to iterate all triangles skipping those that * have been removed. */ - class IteratorOfTriangle : public NCollection_Vector::Iterator + class IteratorOfTriangle : public NCollection_DynamicArray::Iterator { public: //! Constructor @@ -116,7 +116,7 @@ public: /** * Subclass Iterator - allows to iterate all nodes skipping the free ones. */ - class IteratorOfNode : public NCollection_Vector::Iterator + class IteratorOfNode : public NCollection_DynamicArray::Iterator { public: //! Constructor @@ -128,7 +128,7 @@ public: /** * Subclass Iterator - allows to iterate all links skipping invalid ones. */ - class IteratorOfLink : public NCollection_Vector::Iterator + class IteratorOfLink : public NCollection_DynamicArray::Iterator { public: //! Constructor @@ -351,11 +351,11 @@ public: protected: // ---------- PROTECTED FIELDS ---------- - NCollection_Vector myTriangles; - NCollection_Vector myNodes; - NCollection_Vector myLinks; - occ::handle myAlloc; - double myDeflection; + NCollection_DynamicArray myTriangles; + NCollection_DynamicArray myNodes; + NCollection_DynamicArray myLinks; + occ::handle myAlloc; + double myDeflection; public: // Declaration of CASCADE RTTI diff --git a/src/FoundationClasses/TKernel/GTests/FILES.cmake b/src/FoundationClasses/TKernel/GTests/FILES.cmake index a2e2f036c9..db757b8220 100644 --- a/src/FoundationClasses/TKernel/GTests/FILES.cmake +++ b/src/FoundationClasses/TKernel/GTests/FILES.cmake @@ -30,7 +30,6 @@ set(OCCT_TKernel_GTests_FILES NCollection_SparseArray_Test.cxx NCollection_UBTree_Test.cxx NCollection_Vec4_Test.cxx - NCollection_Vector_Test.cxx OSD_Path_Test.cxx OSD_PerfMeter_Test.cxx Quantity_Color_Test.cxx diff --git a/src/FoundationClasses/TKernel/GTests/NCollection_BaseAllocator_Test.cxx b/src/FoundationClasses/TKernel/GTests/NCollection_BaseAllocator_Test.cxx index 8372f9b890..7f768472b4 100644 --- a/src/FoundationClasses/TKernel/GTests/NCollection_BaseAllocator_Test.cxx +++ b/src/FoundationClasses/TKernel/GTests/NCollection_BaseAllocator_Test.cxx @@ -12,7 +12,7 @@ // commercial license or contractual agreement. #include -#include +#include #include @@ -133,7 +133,7 @@ TEST(NCollection_BaseAllocatorTest, AllocateArray) TEST(NCollection_BaseAllocatorTest, UsageWithVector) { // Create a collection using the default allocator - NCollection_Vector aVector; + NCollection_DynamicArray aVector; // Add elements aVector.Append(TestStruct(10, 1.0, 'X')); @@ -159,7 +159,7 @@ TEST(NCollection_BaseAllocatorTest, UsageWithVector) NCollection_BaseAllocator::CommonBaseAllocator(); // Create a collection using custom allocator - NCollection_Vector aVectorWithCustomAlloc(5, aCustomAlloc); + NCollection_DynamicArray aVectorWithCustomAlloc(5, aCustomAlloc); // Add elements aVectorWithCustomAlloc.Append(TestStruct(40, 4.0, 'P')); @@ -182,12 +182,12 @@ TEST(NCollection_BaseAllocatorTest, CopyAndMove) NCollection_BaseAllocator::CommonBaseAllocator(); // Create a collection with allocator - NCollection_Vector aVector1(5, anAlloc1); + NCollection_DynamicArray aVector1(5, anAlloc1); aVector1.Append(TestStruct(10, 1.0, 'A')); aVector1.Append(TestStruct(20, 2.0, 'B')); // Copy constructor should preserve the allocator - NCollection_Vector aVector2(aVector1); + NCollection_DynamicArray aVector2(aVector1); EXPECT_EQ(aVector2.Length(), 2); EXPECT_EQ(aVector2(0), TestStruct(10, 1.0, 'A')); EXPECT_EQ(aVector2(1), TestStruct(20, 2.0, 'B')); @@ -195,7 +195,7 @@ TEST(NCollection_BaseAllocatorTest, CopyAndMove) // Create a new collection with new allocator occ::handle anAlloc2 = NCollection_BaseAllocator::CommonBaseAllocator(); - NCollection_Vector aVector3(5, anAlloc2); + NCollection_DynamicArray aVector3(5, anAlloc2); // Assignment operator should preserve the destination's allocator aVector3 = aVector1; diff --git a/src/FoundationClasses/TKernel/GTests/NCollection_DynamicArray_Test.cxx b/src/FoundationClasses/TKernel/GTests/NCollection_DynamicArray_Test.cxx index 67f739e6df..fce5a63968 100644 --- a/src/FoundationClasses/TKernel/GTests/NCollection_DynamicArray_Test.cxx +++ b/src/FoundationClasses/TKernel/GTests/NCollection_DynamicArray_Test.cxx @@ -1,4 +1,4 @@ -// Copyright (c) 2026 OPEN CASCADE SAS +// Copyright (c) 2025 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // @@ -11,11 +11,794 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include -#include +#include #include -#include +#include +#include +#include + +TEST(NCollection_DynamicArrayTest, DefaultConstructor) +{ + // Default constructor should create an empty vector + NCollection_DynamicArray aVector; + + EXPECT_EQ(0, aVector.Length()); + EXPECT_TRUE(aVector.IsEmpty()); +} + +TEST(NCollection_DynamicArrayTest, ResizeConstructor) +{ + // Test constructor with initial size + const int initialSize = 10; + const int initialValue = 42; + NCollection_DynamicArray aVector(initialSize); + + // Initialize all elements to the same value + for (int i = 0; i < initialSize; i++) + { + aVector.SetValue(i, initialValue); + } + + EXPECT_EQ(initialSize, aVector.Length()); + EXPECT_FALSE(aVector.IsEmpty()); + + // Check all values are initialized + for (int i = 0; i < initialSize; i++) + { + EXPECT_EQ(initialValue, aVector(i)); + } +} + +TEST(NCollection_DynamicArrayTest, Append) +{ + NCollection_DynamicArray aVector; + + // Test Append method + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + EXPECT_EQ(3, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(30, aVector(2)); +} + +TEST(NCollection_DynamicArrayTest, SetValue) +{ + NCollection_DynamicArray aVector(5, nullptr); + + // Test SetValue method + aVector.SetValue(2, 42); + + EXPECT_EQ(42, aVector(2)); + EXPECT_EQ(0, aVector(0)); + EXPECT_EQ(0, aVector(1)); + + // Test operator() + aVector(3) = 99; + EXPECT_EQ(99, aVector(3)); +} + +TEST(NCollection_DynamicArrayTest, Value) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + + // Test Value and operator() + EXPECT_EQ(10, aVector.Value(0)); + EXPECT_EQ(20, aVector.Value(1)); + + EXPECT_EQ(aVector.Value(0), aVector(0)); + EXPECT_EQ(aVector.Value(1), aVector(1)); +} + +TEST(NCollection_DynamicArrayTest, ChangeValue) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + + // Test ChangeValue + aVector.ChangeValue(1) = 25; + EXPECT_EQ(25, aVector(1)); + + // Equivalent using operator() + aVector(0) = 15; + EXPECT_EQ(15, aVector(0)); +} + +TEST(NCollection_DynamicArrayTest, FirstLast) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Test First and Last + EXPECT_EQ(10, aVector.First()); + EXPECT_EQ(30, aVector.Last()); + + // Test ChangeFirst and ChangeLast + aVector.ChangeFirst() = 15; + aVector.ChangeLast() = 35; + + EXPECT_EQ(15, aVector.First()); + EXPECT_EQ(35, aVector.Last()); +} + +TEST(NCollection_DynamicArrayTest, CopyConstructor) +{ + NCollection_DynamicArray aVector1; + aVector1.Append(10); + aVector1.Append(20); + aVector1.Append(30); + + // Test copy constructor + NCollection_DynamicArray aVector2(aVector1); + + EXPECT_EQ(aVector1.Length(), aVector2.Length()); + + for (int i = 0; i < aVector1.Length(); i++) + { + EXPECT_EQ(aVector1(i), aVector2(i)); + } + + // Modify original to ensure deep copy + aVector1(1) = 25; + EXPECT_EQ(20, aVector2(1)); +} + +TEST(NCollection_DynamicArrayTest, AssignmentOperator) +{ + NCollection_DynamicArray aVector1; + aVector1.Append(10); + aVector1.Append(20); + aVector1.Append(30); + + // Test assignment operator + NCollection_DynamicArray aVector2; + aVector2 = aVector1; + + EXPECT_EQ(aVector1.Length(), aVector2.Length()); + + for (int i = 0; i < aVector1.Length(); i++) + { + EXPECT_EQ(aVector1(i), aVector2(i)); + } + + // Modify original to ensure deep copy + aVector1(1) = 25; + EXPECT_EQ(20, aVector2(1)); +} + +TEST(NCollection_DynamicArrayTest, Clear) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + + // Test Clear + aVector.Clear(); + + EXPECT_EQ(0, aVector.Length()); + EXPECT_TRUE(aVector.IsEmpty()); +} + +TEST(NCollection_DynamicArrayTest, Iterator) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Test iterator + int sum = 0; + for (NCollection_DynamicArray::Iterator it(aVector); it.More(); it.Next()) + { + sum += it.Value(); + } + + EXPECT_EQ(60, sum); + + // Test modifying values through iterator + for (NCollection_DynamicArray::Iterator it(aVector); it.More(); it.Next()) + { + it.ChangeValue() *= 2; + } + + EXPECT_EQ(20, aVector(0)); + EXPECT_EQ(40, aVector(1)); + EXPECT_EQ(60, aVector(2)); +} + +TEST(NCollection_DynamicArrayTest, STLIterators) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Test C++11 range-based for loop with STL-style iterators + int sum = 0; + for (const auto& val : aVector) + { + sum += val; + } + + EXPECT_EQ(60, sum); + + // Test modification through iterator + sum = 0; + for (auto& val : aVector) + { + val *= 2; // Double each value + sum += val; + } + + EXPECT_EQ(120, sum); + + // Verify the modifications + EXPECT_EQ(20, aVector(0)); + EXPECT_EQ(40, aVector(1)); + EXPECT_EQ(60, aVector(2)); +} + +TEST(NCollection_DynamicArrayTest, Grow) +{ + NCollection_DynamicArray aVector; + + // Test automatic resize through many appends + for (int i = 0; i < 1000; i++) + { + aVector.Append(i); + } + + EXPECT_EQ(1000, aVector.Length()); + + for (int i = 0; i < 1000; i++) + { + EXPECT_EQ(i, aVector(i)); + } +} + +TEST(NCollection_DynamicArrayTest, Move) +{ + NCollection_DynamicArray aVector1; + aVector1.Append(10); + aVector1.Append(20); + + // Test Move constructor + NCollection_DynamicArray aVector2 = std::move(aVector1); + + EXPECT_EQ(0, aVector1.Length()); // aVector1 should be empty after move + EXPECT_EQ(2, aVector2.Length()); + EXPECT_EQ(10, aVector2(0)); + EXPECT_EQ(20, aVector2(1)); + + // Test Move assignment + NCollection_DynamicArray aVector3; + aVector3.Append(30); + aVector3 = std::move(aVector2); + + EXPECT_EQ(0, aVector2.Length()); // aVector2 should be empty after move + EXPECT_EQ(2, aVector3.Length()); + EXPECT_EQ(10, aVector3(0)); + EXPECT_EQ(20, aVector3(1)); +} + +TEST(NCollection_DynamicArrayTest, EraseLast) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + EXPECT_EQ(3, aVector.Length()); + + // Test EraseLast method + aVector.EraseLast(); + EXPECT_EQ(2, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + + // Remove another element + aVector.EraseLast(); + EXPECT_EQ(1, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + + // Remove the last element + aVector.EraseLast(); + EXPECT_EQ(0, aVector.Length()); + EXPECT_TRUE(aVector.IsEmpty()); + + // Calling EraseLast on an empty vector should not cause errors + aVector.EraseLast(); + EXPECT_EQ(0, aVector.Length()); +} + +TEST(NCollection_DynamicArrayTest, Appended) +{ + NCollection_DynamicArray aVector; + + // Test Appended method - returns reference to the appended element + int& ref1 = aVector.Appended(); + ref1 = 10; + + int& ref2 = aVector.Appended(); + ref2 = 20; + + EXPECT_EQ(2, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + + // Modify through the reference + ref1 = 15; + EXPECT_EQ(15, aVector(0)); +} + +TEST(NCollection_DynamicArrayTest, CustomAllocator) +{ + // Test with custom allocator + occ::handle anAlloc = NCollection_BaseAllocator::CommonBaseAllocator(); + NCollection_DynamicArray aVector(256, anAlloc); + + // Verify vector works with custom allocator + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + EXPECT_EQ(3, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(30, aVector(2)); + + // Test clear with custom allocator + aVector.Clear(); + EXPECT_EQ(0, aVector.Length()); +} + +TEST(NCollection_DynamicArrayTest, SetIncrement) +{ + NCollection_DynamicArray aVector; + + // SetIncrement only works on empty vectors + aVector.SetIncrement(512); + + // Fill the vector to test the custom increment size + for (int i = 0; i < 1000; i++) + { + aVector.Append(i); + } + + EXPECT_EQ(1000, aVector.Length()); + + // Verify data integrity with the custom increment + for (int i = 0; i < 1000; i++) + { + EXPECT_EQ(i, aVector(i)); + } +} + +TEST(NCollection_DynamicArrayTest, STLAlgorithmCompatibility_MinMax) +{ + NCollection_DynamicArray aVector; + std::vector aStdVector; + + std::mt19937 aGenerator(1); // Fixed seed for reproducible tests + std::uniform_int_distribution aDistribution(0, RAND_MAX); + for (int anIdx = 0; anIdx < 100; ++anIdx) + { + int aVal = aDistribution(aGenerator); + aVector.Append(aVal); + aStdVector.push_back(aVal); + } + + auto aMinOCCT = std::min_element(aVector.begin(), aVector.end()); + auto aMinStd = std::min_element(aStdVector.begin(), aStdVector.end()); + + auto aMaxOCCT = std::max_element(aVector.begin(), aVector.end()); + auto aMaxStd = std::max_element(aStdVector.begin(), aStdVector.end()); + + EXPECT_EQ(*aMinOCCT, *aMinStd); + EXPECT_EQ(*aMaxOCCT, *aMaxStd); +} + +TEST(NCollection_DynamicArrayTest, STLAlgorithmCompatibility_Replace) +{ + NCollection_DynamicArray aVector; + std::vector aStdVector; + + std::mt19937 aGenerator(1); // Fixed seed for reproducible tests + std::uniform_int_distribution aDistribution(0, RAND_MAX); + for (int anIdx = 0; anIdx < 100; ++anIdx) + { + int aVal = aDistribution(aGenerator); + aVector.Append(aVal); + aStdVector.push_back(aVal); + } + + int aTargetValue = aStdVector.back(); + int aNewValue = -1; + + std::replace(aVector.begin(), aVector.end(), aTargetValue, aNewValue); + std::replace(aStdVector.begin(), aStdVector.end(), aTargetValue, aNewValue); + + EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); +} + +TEST(NCollection_DynamicArrayTest, STLAlgorithmCompatibility_Reverse) +{ + NCollection_DynamicArray aVector; + std::vector aStdVector; + + for (int anIdx = 0; anIdx < 100; ++anIdx) + { + aVector.Append(anIdx); + aStdVector.push_back(anIdx); + } + + std::reverse(aVector.begin(), aVector.end()); + std::reverse(aStdVector.begin(), aStdVector.end()); + + EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); +} + +TEST(NCollection_DynamicArrayTest, STLAlgorithmCompatibility_Sort) +{ + NCollection_DynamicArray aVector; + std::vector aStdVector; + + std::mt19937 aGenerator(1); // Fixed seed for reproducible tests + std::uniform_int_distribution aDistribution(0, RAND_MAX); + for (int anIdx = 0; anIdx < 100; ++anIdx) + { + int aVal = aDistribution(aGenerator); + aVector.Append(aVal); + aStdVector.push_back(aVal); + } + + std::sort(aVector.begin(), aVector.end()); + std::sort(aStdVector.begin(), aStdVector.end()); + + EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); +} + +// Helper struct for testing in-place construction with multiple arguments +struct VecMultiArgType +{ + int myA; + double myB; + + VecMultiArgType() + : myA(0), + myB(0.0) + { + } + + VecMultiArgType(int theA, double theB) + : myA(theA), + myB(theB) + { + } +}; + +// Helper struct for testing move-only types +struct VecMoveOnlyType +{ + int myValue; + + VecMoveOnlyType() + : myValue(0) + { + } + + explicit VecMoveOnlyType(int theValue) + : myValue(theValue) + { + } + + VecMoveOnlyType(VecMoveOnlyType&& theOther) noexcept + : myValue(theOther.myValue) + { + theOther.myValue = 0; + } + + VecMoveOnlyType& operator=(VecMoveOnlyType&& theOther) noexcept + { + myValue = theOther.myValue; + theOther.myValue = 0; + return *this; + } + + VecMoveOnlyType(const VecMoveOnlyType&) = delete; + VecMoveOnlyType& operator=(const VecMoveOnlyType&) = delete; +}; + +TEST(NCollection_DynamicArrayTest, EmplaceAppend) +{ + NCollection_DynamicArray aVector; + + // Test EmplaceAppend with multiple constructor arguments + VecMultiArgType& aRef1 = aVector.EmplaceAppend(42, 3.14); + EXPECT_EQ(42, aRef1.myA); + EXPECT_NEAR(3.14, aRef1.myB, 1e-10); + EXPECT_EQ(1, aVector.Length()); + + VecMultiArgType& aRef2 = aVector.EmplaceAppend(100, 2.71); + EXPECT_EQ(100, aRef2.myA); + EXPECT_NEAR(2.71, aRef2.myB, 1e-10); + EXPECT_EQ(2, aVector.Length()); + + // Verify the order (0-based indexing) + EXPECT_EQ(42, aVector(0).myA); + EXPECT_EQ(100, aVector(1).myA); +} + +TEST(NCollection_DynamicArrayTest, EmplaceValue) +{ + NCollection_DynamicArray aVector; + + // Test EmplaceValue at index 0 + VecMultiArgType& aRef1 = aVector.EmplaceValue(0, 10, 1.0); + EXPECT_EQ(10, aRef1.myA); + EXPECT_NEAR(1.0, aRef1.myB, 1e-10); + EXPECT_EQ(1, aVector.Length()); + + // Test EmplaceValue at index beyond current size (should fill with default values) + VecMultiArgType& aRef2 = aVector.EmplaceValue(3, 40, 4.0); + EXPECT_EQ(40, aRef2.myA); + EXPECT_NEAR(4.0, aRef2.myB, 1e-10); + EXPECT_EQ(4, aVector.Length()); + + // Check that intermediate elements were default-constructed + EXPECT_EQ(0, aVector(1).myA); + EXPECT_NEAR(0.0, aVector(1).myB, 1e-10); + EXPECT_EQ(0, aVector(2).myA); + EXPECT_NEAR(0.0, aVector(2).myB, 1e-10); +} + +TEST(NCollection_DynamicArrayTest, EmplaceValue_ReplacesExisting) +{ + NCollection_DynamicArray aVector; + + // Set initial values + aVector.EmplaceValue(0, 10, 1.0); + aVector.EmplaceValue(1, 20, 2.0); + aVector.EmplaceValue(2, 30, 3.0); + + EXPECT_EQ(3, aVector.Length()); + + // Replace value at index 1 (existing element) + VecMultiArgType& aRef = aVector.EmplaceValue(1, 200, 20.0); + EXPECT_EQ(200, aRef.myA); + EXPECT_NEAR(20.0, aRef.myB, 1e-10); + + // Verify other values unchanged and size unchanged + EXPECT_EQ(3, aVector.Length()); + EXPECT_EQ(10, aVector(0).myA); + EXPECT_EQ(200, aVector(1).myA); + EXPECT_EQ(30, aVector(2).myA); +} + +TEST(NCollection_DynamicArrayTest, EmplaceWithMoveOnlyType) +{ + NCollection_DynamicArray aVector; + + // Test EmplaceAppend with move-only type + VecMoveOnlyType& aRef1 = aVector.EmplaceAppend(42); + EXPECT_EQ(42, aRef1.myValue); + + VecMoveOnlyType& aRef2 = aVector.EmplaceAppend(100); + EXPECT_EQ(100, aRef2.myValue); + + EXPECT_EQ(2, aVector.Length()); + EXPECT_EQ(42, aVector(0).myValue); + EXPECT_EQ(100, aVector(1).myValue); +} + +TEST(NCollection_DynamicArrayTest, EmplaceAppendMany) +{ + NCollection_DynamicArray aVector; + + // Test EmplaceAppend with many elements to trigger internal array expansion + for (int i = 0; i < 1000; i++) + { + VecMultiArgType& aRef = aVector.EmplaceAppend(i, static_cast(i) * 0.1); + EXPECT_EQ(i, aRef.myA); + EXPECT_NEAR(static_cast(i) * 0.1, aRef.myB, 1e-10); + } + + EXPECT_EQ(1000, aVector.Length()); + + // Verify all values + for (int i = 0; i < 1000; i++) + { + EXPECT_EQ(i, aVector(i).myA); + EXPECT_NEAR(static_cast(i) * 0.1, aVector(i).myB, 1e-10); + } +} + +TEST(NCollection_DynamicArrayTest, SetValue_ReplacesExisting) +{ + NCollection_DynamicArray aVector; + + // Set initial values + aVector.SetValue(0, VecMultiArgType(10, 1.0)); + aVector.SetValue(1, VecMultiArgType(20, 2.0)); + aVector.SetValue(2, VecMultiArgType(30, 3.0)); + + EXPECT_EQ(3, aVector.Length()); + + // Replace value at index 1 (existing element) + VecMultiArgType& aRef = aVector.SetValue(1, VecMultiArgType(200, 20.0)); + EXPECT_EQ(200, aRef.myA); + EXPECT_NEAR(20.0, aRef.myB, 1e-10); + + // Verify other values unchanged and size unchanged + EXPECT_EQ(3, aVector.Length()); + EXPECT_EQ(10, aVector(0).myA); + EXPECT_EQ(200, aVector(1).myA); + EXPECT_EQ(30, aVector(2).myA); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_Middle) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + aVector.Append(40); + + // Insert 99 after index 1 (after 20): [10, 20, 99, 30, 40] + aVector.InsertAfter(1, 99); + + EXPECT_EQ(5, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(99, aVector(2)); + EXPECT_EQ(30, aVector(3)); + EXPECT_EQ(40, aVector(4)); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_First) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Insert 99 after index 0 (after 10): [10, 99, 20, 30] + aVector.InsertAfter(0, 99); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(99, aVector(1)); + EXPECT_EQ(20, aVector(2)); + EXPECT_EQ(30, aVector(3)); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_Last) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Insert 99 after last index (after 30): [10, 20, 30, 99] + aVector.InsertAfter(2, 99); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(30, aVector(2)); + EXPECT_EQ(99, aVector(3)); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_SingleElement) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + + // Insert 99 after index 0: [10, 99] + aVector.InsertAfter(0, 99); + + EXPECT_EQ(2, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(99, aVector(1)); +} + +TEST(NCollection_DynamicArrayTest, InsertBefore_Middle) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + aVector.Append(40); + + // Insert 99 before index 2 (before 30): [10, 20, 99, 30, 40] + aVector.InsertBefore(2, 99); + + EXPECT_EQ(5, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(99, aVector(2)); + EXPECT_EQ(30, aVector(3)); + EXPECT_EQ(40, aVector(4)); +} + +TEST(NCollection_DynamicArrayTest, InsertBefore_First) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Insert 99 before index 0: [99, 10, 20, 30] + aVector.InsertBefore(0, 99); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(99, aVector(0)); + EXPECT_EQ(10, aVector(1)); + EXPECT_EQ(20, aVector(2)); + EXPECT_EQ(30, aVector(3)); +} + +TEST(NCollection_DynamicArrayTest, InsertBefore_Last) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(20); + aVector.Append(30); + + // Insert 99 before last index (before 30): [10, 20, 99, 30] + aVector.InsertBefore(2, 99); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(99, aVector(2)); + EXPECT_EQ(30, aVector(3)); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_MoveSemantics) +{ + NCollection_DynamicArray aVector; + aVector.EmplaceAppend(10); + aVector.EmplaceAppend(20); + aVector.EmplaceAppend(30); + + // Move-insert 99 after index 1: [10, 20, 99, 30] + aVector.InsertAfter(1, VecMoveOnlyType(99)); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(10, aVector(0).myValue); + EXPECT_EQ(20, aVector(1).myValue); + EXPECT_EQ(99, aVector(2).myValue); + EXPECT_EQ(30, aVector(3).myValue); +} + +TEST(NCollection_DynamicArrayTest, InsertAfter_MultipleInserts) +{ + NCollection_DynamicArray aVector; + aVector.Append(10); + aVector.Append(40); + + // Insert 20 after 10: [10, 20, 40] + aVector.InsertAfter(0, 20); + // Insert 30 after 20: [10, 20, 30, 40] + aVector.InsertAfter(1, 30); + + EXPECT_EQ(4, aVector.Length()); + EXPECT_EQ(10, aVector(0)); + EXPECT_EQ(20, aVector(1)); + EXPECT_EQ(30, aVector(2)); + EXPECT_EQ(40, aVector(3)); +} TEST(NCollection_DynamicArrayTest, SizeReturnsSizeT) { @@ -127,4 +910,4 @@ TEST(NCollection_DynamicArrayTest, IntAndSizeTOverloadsAgree) { EXPECT_EQ(aVecInt.Value(i), aVecSize.Value(static_cast(i))); } -} +} \ No newline at end of file diff --git a/src/FoundationClasses/TKernel/GTests/NCollection_Vector_Test.cxx b/src/FoundationClasses/TKernel/GTests/NCollection_Vector_Test.cxx deleted file mode 100644 index f8fc1ec813..0000000000 --- a/src/FoundationClasses/TKernel/GTests/NCollection_Vector_Test.cxx +++ /dev/null @@ -1,801 +0,0 @@ -// Copyright (c) 2025 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include - -#include -#include -#include -#include - -TEST(NCollection_VectorTest, DefaultConstructor) -{ - // Default constructor should create an empty vector - NCollection_Vector aVector; - - EXPECT_EQ(0, aVector.Length()); - EXPECT_TRUE(aVector.IsEmpty()); -} - -TEST(NCollection_VectorTest, ResizeConstructor) -{ - // Test constructor with initial size - const int initialSize = 10; - const int initialValue = 42; - NCollection_Vector aVector(initialSize); - - // Initialize all elements to the same value - for (int i = 0; i < initialSize; i++) - { - aVector.SetValue(i, initialValue); - } - - EXPECT_EQ(initialSize, aVector.Length()); - EXPECT_FALSE(aVector.IsEmpty()); - - // Check all values are initialized - for (int i = 0; i < initialSize; i++) - { - EXPECT_EQ(initialValue, aVector(i)); - } -} - -TEST(NCollection_VectorTest, Append) -{ - NCollection_Vector aVector; - - // Test Append method - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - EXPECT_EQ(3, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(30, aVector(2)); -} - -TEST(NCollection_VectorTest, SetValue) -{ - NCollection_Vector aVector(5, nullptr); - - // Test SetValue method - aVector.SetValue(2, 42); - - EXPECT_EQ(42, aVector(2)); - EXPECT_EQ(0, aVector(0)); - EXPECT_EQ(0, aVector(1)); - - // Test operator() - aVector(3) = 99; - EXPECT_EQ(99, aVector(3)); -} - -TEST(NCollection_VectorTest, Value) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - - // Test Value and operator() - EXPECT_EQ(10, aVector.Value(0)); - EXPECT_EQ(20, aVector.Value(1)); - - EXPECT_EQ(aVector.Value(0), aVector(0)); - EXPECT_EQ(aVector.Value(1), aVector(1)); -} - -TEST(NCollection_VectorTest, ChangeValue) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - - // Test ChangeValue - aVector.ChangeValue(1) = 25; - EXPECT_EQ(25, aVector(1)); - - // Equivalent using operator() - aVector(0) = 15; - EXPECT_EQ(15, aVector(0)); -} - -TEST(NCollection_VectorTest, FirstLast) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Test First and Last - EXPECT_EQ(10, aVector.First()); - EXPECT_EQ(30, aVector.Last()); - - // Test ChangeFirst and ChangeLast - aVector.ChangeFirst() = 15; - aVector.ChangeLast() = 35; - - EXPECT_EQ(15, aVector.First()); - EXPECT_EQ(35, aVector.Last()); -} - -TEST(NCollection_VectorTest, CopyConstructor) -{ - NCollection_Vector aVector1; - aVector1.Append(10); - aVector1.Append(20); - aVector1.Append(30); - - // Test copy constructor - NCollection_Vector aVector2(aVector1); - - EXPECT_EQ(aVector1.Length(), aVector2.Length()); - - for (int i = 0; i < aVector1.Length(); i++) - { - EXPECT_EQ(aVector1(i), aVector2(i)); - } - - // Modify original to ensure deep copy - aVector1(1) = 25; - EXPECT_EQ(20, aVector2(1)); -} - -TEST(NCollection_VectorTest, AssignmentOperator) -{ - NCollection_Vector aVector1; - aVector1.Append(10); - aVector1.Append(20); - aVector1.Append(30); - - // Test assignment operator - NCollection_Vector aVector2; - aVector2 = aVector1; - - EXPECT_EQ(aVector1.Length(), aVector2.Length()); - - for (int i = 0; i < aVector1.Length(); i++) - { - EXPECT_EQ(aVector1(i), aVector2(i)); - } - - // Modify original to ensure deep copy - aVector1(1) = 25; - EXPECT_EQ(20, aVector2(1)); -} - -TEST(NCollection_VectorTest, Clear) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - - // Test Clear - aVector.Clear(); - - EXPECT_EQ(0, aVector.Length()); - EXPECT_TRUE(aVector.IsEmpty()); -} - -TEST(NCollection_VectorTest, Iterator) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Test iterator - int sum = 0; - for (NCollection_Vector::Iterator it(aVector); it.More(); it.Next()) - { - sum += it.Value(); - } - - EXPECT_EQ(60, sum); - - // Test modifying values through iterator - for (NCollection_Vector::Iterator it(aVector); it.More(); it.Next()) - { - it.ChangeValue() *= 2; - } - - EXPECT_EQ(20, aVector(0)); - EXPECT_EQ(40, aVector(1)); - EXPECT_EQ(60, aVector(2)); -} - -TEST(NCollection_VectorTest, STLIterators) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Test C++11 range-based for loop with STL-style iterators - int sum = 0; - for (const auto& val : aVector) - { - sum += val; - } - - EXPECT_EQ(60, sum); - - // Test modification through iterator - sum = 0; - for (auto& val : aVector) - { - val *= 2; // Double each value - sum += val; - } - - EXPECT_EQ(120, sum); - - // Verify the modifications - EXPECT_EQ(20, aVector(0)); - EXPECT_EQ(40, aVector(1)); - EXPECT_EQ(60, aVector(2)); -} - -TEST(NCollection_VectorTest, Grow) -{ - NCollection_Vector aVector; - - // Test automatic resize through many appends - for (int i = 0; i < 1000; i++) - { - aVector.Append(i); - } - - EXPECT_EQ(1000, aVector.Length()); - - for (int i = 0; i < 1000; i++) - { - EXPECT_EQ(i, aVector(i)); - } -} - -TEST(NCollection_VectorTest, Move) -{ - NCollection_Vector aVector1; - aVector1.Append(10); - aVector1.Append(20); - - // Test Move constructor - NCollection_Vector aVector2 = std::move(aVector1); - - EXPECT_EQ(0, aVector1.Length()); // aVector1 should be empty after move - EXPECT_EQ(2, aVector2.Length()); - EXPECT_EQ(10, aVector2(0)); - EXPECT_EQ(20, aVector2(1)); - - // Test Move assignment - NCollection_Vector aVector3; - aVector3.Append(30); - aVector3 = std::move(aVector2); - - EXPECT_EQ(0, aVector2.Length()); // aVector2 should be empty after move - EXPECT_EQ(2, aVector3.Length()); - EXPECT_EQ(10, aVector3(0)); - EXPECT_EQ(20, aVector3(1)); -} - -TEST(NCollection_VectorTest, EraseLast) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - EXPECT_EQ(3, aVector.Length()); - - // Test EraseLast method - aVector.EraseLast(); - EXPECT_EQ(2, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - - // Remove another element - aVector.EraseLast(); - EXPECT_EQ(1, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - - // Remove the last element - aVector.EraseLast(); - EXPECT_EQ(0, aVector.Length()); - EXPECT_TRUE(aVector.IsEmpty()); - - // Calling EraseLast on an empty vector should not cause errors - aVector.EraseLast(); - EXPECT_EQ(0, aVector.Length()); -} - -TEST(NCollection_VectorTest, Appended) -{ - NCollection_Vector aVector; - - // Test Appended method - returns reference to the appended element - int& ref1 = aVector.Appended(); - ref1 = 10; - - int& ref2 = aVector.Appended(); - ref2 = 20; - - EXPECT_EQ(2, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - - // Modify through the reference - ref1 = 15; - EXPECT_EQ(15, aVector(0)); -} - -TEST(NCollection_VectorTest, CustomAllocator) -{ - // Test with custom allocator - occ::handle anAlloc = NCollection_BaseAllocator::CommonBaseAllocator(); - NCollection_Vector aVector(256, anAlloc); - - // Verify vector works with custom allocator - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - EXPECT_EQ(3, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(30, aVector(2)); - - // Test clear with custom allocator - aVector.Clear(); - EXPECT_EQ(0, aVector.Length()); -} - -TEST(NCollection_VectorTest, SetIncrement) -{ - NCollection_Vector aVector; - - // SetIncrement only works on empty vectors - aVector.SetIncrement(512); - - // Fill the vector to test the custom increment size - for (int i = 0; i < 1000; i++) - { - aVector.Append(i); - } - - EXPECT_EQ(1000, aVector.Length()); - - // Verify data integrity with the custom increment - for (int i = 0; i < 1000; i++) - { - EXPECT_EQ(i, aVector(i)); - } -} - -TEST(NCollection_VectorTest, STLAlgorithmCompatibility_MinMax) -{ - NCollection_Vector aVector; - std::vector aStdVector; - - std::mt19937 aGenerator(1); // Fixed seed for reproducible tests - std::uniform_int_distribution aDistribution(0, RAND_MAX); - for (int anIdx = 0; anIdx < 100; ++anIdx) - { - int aVal = aDistribution(aGenerator); - aVector.Append(aVal); - aStdVector.push_back(aVal); - } - - auto aMinOCCT = std::min_element(aVector.begin(), aVector.end()); - auto aMinStd = std::min_element(aStdVector.begin(), aStdVector.end()); - - auto aMaxOCCT = std::max_element(aVector.begin(), aVector.end()); - auto aMaxStd = std::max_element(aStdVector.begin(), aStdVector.end()); - - EXPECT_EQ(*aMinOCCT, *aMinStd); - EXPECT_EQ(*aMaxOCCT, *aMaxStd); -} - -TEST(NCollection_VectorTest, STLAlgorithmCompatibility_Replace) -{ - NCollection_Vector aVector; - std::vector aStdVector; - - std::mt19937 aGenerator(1); // Fixed seed for reproducible tests - std::uniform_int_distribution aDistribution(0, RAND_MAX); - for (int anIdx = 0; anIdx < 100; ++anIdx) - { - int aVal = aDistribution(aGenerator); - aVector.Append(aVal); - aStdVector.push_back(aVal); - } - - int aTargetValue = aStdVector.back(); - int aNewValue = -1; - - std::replace(aVector.begin(), aVector.end(), aTargetValue, aNewValue); - std::replace(aStdVector.begin(), aStdVector.end(), aTargetValue, aNewValue); - - EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); -} - -TEST(NCollection_VectorTest, STLAlgorithmCompatibility_Reverse) -{ - NCollection_Vector aVector; - std::vector aStdVector; - - for (int anIdx = 0; anIdx < 100; ++anIdx) - { - aVector.Append(anIdx); - aStdVector.push_back(anIdx); - } - - std::reverse(aVector.begin(), aVector.end()); - std::reverse(aStdVector.begin(), aStdVector.end()); - - EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); -} - -TEST(NCollection_VectorTest, STLAlgorithmCompatibility_Sort) -{ - NCollection_Vector aVector; - std::vector aStdVector; - - std::mt19937 aGenerator(1); // Fixed seed for reproducible tests - std::uniform_int_distribution aDistribution(0, RAND_MAX); - for (int anIdx = 0; anIdx < 100; ++anIdx) - { - int aVal = aDistribution(aGenerator); - aVector.Append(aVal); - aStdVector.push_back(aVal); - } - - std::sort(aVector.begin(), aVector.end()); - std::sort(aStdVector.begin(), aStdVector.end()); - - EXPECT_TRUE(std::equal(aVector.begin(), aVector.end(), aStdVector.begin())); -} - -// Helper struct for testing in-place construction with multiple arguments -struct VecMultiArgType -{ - int myA; - double myB; - - VecMultiArgType() - : myA(0), - myB(0.0) - { - } - - VecMultiArgType(int theA, double theB) - : myA(theA), - myB(theB) - { - } -}; - -// Helper struct for testing move-only types -struct VecMoveOnlyType -{ - int myValue; - - VecMoveOnlyType() - : myValue(0) - { - } - - explicit VecMoveOnlyType(int theValue) - : myValue(theValue) - { - } - - VecMoveOnlyType(VecMoveOnlyType&& theOther) noexcept - : myValue(theOther.myValue) - { - theOther.myValue = 0; - } - - VecMoveOnlyType& operator=(VecMoveOnlyType&& theOther) noexcept - { - myValue = theOther.myValue; - theOther.myValue = 0; - return *this; - } - - VecMoveOnlyType(const VecMoveOnlyType&) = delete; - VecMoveOnlyType& operator=(const VecMoveOnlyType&) = delete; -}; - -TEST(NCollection_VectorTest, EmplaceAppend) -{ - NCollection_Vector aVector; - - // Test EmplaceAppend with multiple constructor arguments - VecMultiArgType& aRef1 = aVector.EmplaceAppend(42, 3.14); - EXPECT_EQ(42, aRef1.myA); - EXPECT_NEAR(3.14, aRef1.myB, 1e-10); - EXPECT_EQ(1, aVector.Length()); - - VecMultiArgType& aRef2 = aVector.EmplaceAppend(100, 2.71); - EXPECT_EQ(100, aRef2.myA); - EXPECT_NEAR(2.71, aRef2.myB, 1e-10); - EXPECT_EQ(2, aVector.Length()); - - // Verify the order (0-based indexing) - EXPECT_EQ(42, aVector(0).myA); - EXPECT_EQ(100, aVector(1).myA); -} - -TEST(NCollection_VectorTest, EmplaceValue) -{ - NCollection_Vector aVector; - - // Test EmplaceValue at index 0 - VecMultiArgType& aRef1 = aVector.EmplaceValue(0, 10, 1.0); - EXPECT_EQ(10, aRef1.myA); - EXPECT_NEAR(1.0, aRef1.myB, 1e-10); - EXPECT_EQ(1, aVector.Length()); - - // Test EmplaceValue at index beyond current size (should fill with default values) - VecMultiArgType& aRef2 = aVector.EmplaceValue(3, 40, 4.0); - EXPECT_EQ(40, aRef2.myA); - EXPECT_NEAR(4.0, aRef2.myB, 1e-10); - EXPECT_EQ(4, aVector.Length()); - - // Check that intermediate elements were default-constructed - EXPECT_EQ(0, aVector(1).myA); - EXPECT_NEAR(0.0, aVector(1).myB, 1e-10); - EXPECT_EQ(0, aVector(2).myA); - EXPECT_NEAR(0.0, aVector(2).myB, 1e-10); -} - -TEST(NCollection_VectorTest, EmplaceValue_ReplacesExisting) -{ - NCollection_Vector aVector; - - // Set initial values - aVector.EmplaceValue(0, 10, 1.0); - aVector.EmplaceValue(1, 20, 2.0); - aVector.EmplaceValue(2, 30, 3.0); - - EXPECT_EQ(3, aVector.Length()); - - // Replace value at index 1 (existing element) - VecMultiArgType& aRef = aVector.EmplaceValue(1, 200, 20.0); - EXPECT_EQ(200, aRef.myA); - EXPECT_NEAR(20.0, aRef.myB, 1e-10); - - // Verify other values unchanged and size unchanged - EXPECT_EQ(3, aVector.Length()); - EXPECT_EQ(10, aVector(0).myA); - EXPECT_EQ(200, aVector(1).myA); - EXPECT_EQ(30, aVector(2).myA); -} - -TEST(NCollection_VectorTest, EmplaceWithMoveOnlyType) -{ - NCollection_Vector aVector; - - // Test EmplaceAppend with move-only type - VecMoveOnlyType& aRef1 = aVector.EmplaceAppend(42); - EXPECT_EQ(42, aRef1.myValue); - - VecMoveOnlyType& aRef2 = aVector.EmplaceAppend(100); - EXPECT_EQ(100, aRef2.myValue); - - EXPECT_EQ(2, aVector.Length()); - EXPECT_EQ(42, aVector(0).myValue); - EXPECT_EQ(100, aVector(1).myValue); -} - -TEST(NCollection_VectorTest, EmplaceAppendMany) -{ - NCollection_Vector aVector; - - // Test EmplaceAppend with many elements to trigger internal array expansion - for (int i = 0; i < 1000; i++) - { - VecMultiArgType& aRef = aVector.EmplaceAppend(i, static_cast(i) * 0.1); - EXPECT_EQ(i, aRef.myA); - EXPECT_NEAR(static_cast(i) * 0.1, aRef.myB, 1e-10); - } - - EXPECT_EQ(1000, aVector.Length()); - - // Verify all values - for (int i = 0; i < 1000; i++) - { - EXPECT_EQ(i, aVector(i).myA); - EXPECT_NEAR(static_cast(i) * 0.1, aVector(i).myB, 1e-10); - } -} - -TEST(NCollection_VectorTest, SetValue_ReplacesExisting) -{ - NCollection_Vector aVector; - - // Set initial values - aVector.SetValue(0, VecMultiArgType(10, 1.0)); - aVector.SetValue(1, VecMultiArgType(20, 2.0)); - aVector.SetValue(2, VecMultiArgType(30, 3.0)); - - EXPECT_EQ(3, aVector.Length()); - - // Replace value at index 1 (existing element) - VecMultiArgType& aRef = aVector.SetValue(1, VecMultiArgType(200, 20.0)); - EXPECT_EQ(200, aRef.myA); - EXPECT_NEAR(20.0, aRef.myB, 1e-10); - - // Verify other values unchanged and size unchanged - EXPECT_EQ(3, aVector.Length()); - EXPECT_EQ(10, aVector(0).myA); - EXPECT_EQ(200, aVector(1).myA); - EXPECT_EQ(30, aVector(2).myA); -} - -TEST(NCollection_VectorTest, InsertAfter_Middle) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - aVector.Append(40); - - // Insert 99 after index 1 (after 20): [10, 20, 99, 30, 40] - aVector.InsertAfter(1, 99); - - EXPECT_EQ(5, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(99, aVector(2)); - EXPECT_EQ(30, aVector(3)); - EXPECT_EQ(40, aVector(4)); -} - -TEST(NCollection_VectorTest, InsertAfter_First) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Insert 99 after index 0 (after 10): [10, 99, 20, 30] - aVector.InsertAfter(0, 99); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(99, aVector(1)); - EXPECT_EQ(20, aVector(2)); - EXPECT_EQ(30, aVector(3)); -} - -TEST(NCollection_VectorTest, InsertAfter_Last) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Insert 99 after last index (after 30): [10, 20, 30, 99] - aVector.InsertAfter(2, 99); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(30, aVector(2)); - EXPECT_EQ(99, aVector(3)); -} - -TEST(NCollection_VectorTest, InsertAfter_SingleElement) -{ - NCollection_Vector aVector; - aVector.Append(10); - - // Insert 99 after index 0: [10, 99] - aVector.InsertAfter(0, 99); - - EXPECT_EQ(2, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(99, aVector(1)); -} - -TEST(NCollection_VectorTest, InsertBefore_Middle) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - aVector.Append(40); - - // Insert 99 before index 2 (before 30): [10, 20, 99, 30, 40] - aVector.InsertBefore(2, 99); - - EXPECT_EQ(5, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(99, aVector(2)); - EXPECT_EQ(30, aVector(3)); - EXPECT_EQ(40, aVector(4)); -} - -TEST(NCollection_VectorTest, InsertBefore_First) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Insert 99 before index 0: [99, 10, 20, 30] - aVector.InsertBefore(0, 99); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(99, aVector(0)); - EXPECT_EQ(10, aVector(1)); - EXPECT_EQ(20, aVector(2)); - EXPECT_EQ(30, aVector(3)); -} - -TEST(NCollection_VectorTest, InsertBefore_Last) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(20); - aVector.Append(30); - - // Insert 99 before last index (before 30): [10, 20, 99, 30] - aVector.InsertBefore(2, 99); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(99, aVector(2)); - EXPECT_EQ(30, aVector(3)); -} - -TEST(NCollection_VectorTest, InsertAfter_MoveSemantics) -{ - NCollection_Vector aVector; - aVector.EmplaceAppend(10); - aVector.EmplaceAppend(20); - aVector.EmplaceAppend(30); - - // Move-insert 99 after index 1: [10, 20, 99, 30] - aVector.InsertAfter(1, VecMoveOnlyType(99)); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(10, aVector(0).myValue); - EXPECT_EQ(20, aVector(1).myValue); - EXPECT_EQ(99, aVector(2).myValue); - EXPECT_EQ(30, aVector(3).myValue); -} - -TEST(NCollection_VectorTest, InsertAfter_MultipleInserts) -{ - NCollection_Vector aVector; - aVector.Append(10); - aVector.Append(40); - - // Insert 20 after 10: [10, 20, 40] - aVector.InsertAfter(0, 20); - // Insert 30 after 20: [10, 20, 30, 40] - aVector.InsertAfter(1, 30); - - EXPECT_EQ(4, aVector.Length()); - EXPECT_EQ(10, aVector(0)); - EXPECT_EQ(20, aVector(1)); - EXPECT_EQ(30, aVector(2)); - EXPECT_EQ(40, aVector(3)); -} \ No newline at end of file diff --git a/src/FoundationClasses/TKernel/Message/Message.hxx b/src/FoundationClasses/TKernel/Message/Message.hxx index 7754181e5d..20b927c80b 100644 --- a/src/FoundationClasses/TKernel/Message/Message.hxx +++ b/src/FoundationClasses/TKernel/Message/Message.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedIterator.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedIterator.hxx index eedb7d07e3..b33fb99485 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedIterator.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_IndexedIterator.hxx @@ -21,7 +21,7 @@ //! NCollection iterator can be extended to STL iterator of any category by //! adding necessary methods: STL forward iterator requires IsEqual method, //! STL bidirectional iterator requires Previous method, and STL random access -//! iterator requires Offset and Differ methods. See NCollection_Vector as +//! iterator requires Offset and Differ methods. See NCollection_DynamicArray as //! example of declaring custom STL iterators. template class NCollection_IndexedIterator diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_Iterator.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_Iterator.hxx index 78f8dc80ae..cf3f380493 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_Iterator.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_Iterator.hxx @@ -21,7 +21,7 @@ //! NCollection iterator can be extended to STL iterator of any category by //! adding necessary methods: STL forward iterator requires IsEqual method, //! STL bidirectional iterator requires Previous method, and STL random access -//! iterator requires Offset and Differ methods. See NCollection_Vector as +//! iterator requires Offset and Differ methods. See NCollection_DynamicArray as //! example of declaring custom STL iterators. template class NCollection_Iterator diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArray.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArray.hxx index ffb854a374..efd21bc892 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArray.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_SparseArray.hxx @@ -21,7 +21,7 @@ /** * Dynamically resizable sparse array of objects * - * This class is similar to NCollection_Vector: it works like virtually + * This class is similar to NCollection_DynamicArray: it works like virtually * unlimited array of items accessible by index; however unlike simple * Vector it distinguishes items that have been set from the ones that * have not been set explicitly. diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_StlIterator.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_StlIterator.hxx index 1250714341..49238f6dc5 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_StlIterator.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_StlIterator.hxx @@ -23,7 +23,7 @@ //! NCollection iterator can be extended to STL iterator of any category by //! adding necessary methods: STL forward iterator requires IsEqual method, //! STL bidirectional iterator requires Previous method, and STL random access -//! iterator requires Offset and Differ methods. See NCollection_Vector as +//! iterator requires Offset and Differ methods. See NCollection_DynamicArray as //! example of declaring custom STL iterators. template class NCollection_StlIterator diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_UBTreeFiller.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_UBTreeFiller.hxx index feea53099a..dd21af1c2f 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_UBTreeFiller.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_UBTreeFiller.hxx @@ -17,7 +17,7 @@ #define NCollection_UBTreeFiller_HeaderFile #include -#include +#include #include @@ -135,10 +135,10 @@ private: private: // ---------- PRIVATE FIELDS ---------- - UBTree& myTree; - NCollection_Vector mySeqPtr; - std::mt19937 myRandGen; //!< random number generator - bool myIsFullRandom; + UBTree& myTree; + NCollection_DynamicArray mySeqPtr; + std::mt19937 myRandGen; //!< random number generator + bool myIsFullRandom; }; //================================================================================================= diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_Vector.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_Vector.hxx index 20ac59c408..c494ff5bb8 100755 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_Vector.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_Vector.hxx @@ -16,13 +16,14 @@ #ifndef NCollection_Vector_HeaderFile #define NCollection_Vector_HeaderFile +#include #include +Standard_HEADER_DEPRECATED("NCollection_Vector.hxx is deprecated since OCCT 8.0.0. Use " + "NCollection_DynamicArray.hxx directly."); + //! Class NCollection_Vector (dynamic array of objects) //! -//! This class is similar to NCollection_Vector though the indices always start -//! at 0 (in Array1 the first index must be specified) -//! //! The Vector is always created with 0 length. It can be enlarged by two means: //! 1. Calling the method Append (val) - then "val" is added to the end of the //! vector (the vector length is incremented) @@ -40,6 +41,7 @@ //! at index 0 and stops at the index equal to (remembered_length-1). It is OK //! to enlarge the vector during the iteration. template -using NCollection_Vector = NCollection_DynamicArray; +using NCollection_Vector = NCollection_DynamicArray Standard_DEPRECATED( + "NCollection_Vector is deprecated, use NCollection_DynamicArray directly"); #endif // NCollection_Vector_HeaderFile diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_2.cxx index c55e9a8c9d..64a538eb83 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -112,7 +112,7 @@ protected: }; // -typedef NCollection_Vector BOPAlgo_VectorOfPairOfShapeBoolean; +typedef NCollection_DynamicArray BOPAlgo_VectorOfPairOfShapeBoolean; //======================================================================= // class : BOPAlgo_SplitFace @@ -143,7 +143,7 @@ private: Message_ProgressRange myRange; }; -typedef NCollection_Vector BOPAlgo_VectorOfBuilderFace; +typedef NCollection_DynamicArray BOPAlgo_VectorOfBuilderFace; //================================================================================================= @@ -207,7 +207,7 @@ protected: }; // -typedef NCollection_Vector BOPAlgo_VectorOfVFI; +typedef NCollection_DynamicArray BOPAlgo_VectorOfVFI; //================================================================================================= @@ -572,8 +572,8 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange) { // It is necessary to analyze all Face/Face intersections // and find all faces with equal sets of edges - const NCollection_Vector& aFFs = myDS->InterfFF(); - int aNbFFs = aFFs.Length(); + const NCollection_DynamicArray& aFFs = myDS->InterfFF(); + int aNbFFs = aFFs.Length(); if (!aNbFFs) return; @@ -584,7 +584,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange) // Vector to store the indices of faces for future sorting // for making the SD face for the group from the face with // smallest index in Data structure - NCollection_Vector aFIVec(256, aAllocator); + NCollection_DynamicArray aFIVec(256, aAllocator); // Fence map to avoid repeated checks of the same face. NCollection_Map aMFence(1, aAllocator); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_3.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_3.cxx index a704cce9f0..fd107c11f9 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_3.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_3.cxx @@ -43,7 +43,7 @@ // #include #include -#include +#include #include #include @@ -392,7 +392,7 @@ private: }; // Vector of Solid Builders -typedef NCollection_Vector BOPAlgo_VectorOfBuilderSolid; +typedef NCollection_DynamicArray BOPAlgo_VectorOfBuilderSolid; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_4.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_4.cxx index 86240a8d0c..21ff2f620e 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_4.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Builder_4.cxx @@ -58,8 +58,8 @@ const NCollection_List& BOPAlgo_Builder::LocGenerated(const TopoDS // Analyze all types of Interferences which can produce // new vertices - Edge/Edge and Edge/Face - NCollection_Vector& aEEs = myDS->InterfEE(); - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); // Fence map to avoid duplicates in the list of Generated; NCollection_Map aMFence; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI.cxx index 347b6913a9..dbebd3ba08 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ protected: //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfFaceSelfIntersect; +typedef NCollection_DynamicArray BOPAlgo_VectorOfFaceSelfIntersect; //================================================================================================= @@ -208,8 +208,8 @@ void BOPAlgo_CheckerSI::PostTreat() NCollection_Map& aMPK = *((NCollection_Map*)&myDS->Interferences()); // 0 - NCollection_Vector& aVVs = myDS->InterfVV(); - aNb = aVVs.Length(); + NCollection_DynamicArray& aVVs = myDS->InterfVV(); + aNb = aVVs.Length(); for (i = 0; i != aNb; ++i) { const BOPDS_InterfVV& aVV = aVVs(i); @@ -223,8 +223,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 1 - NCollection_Vector& aVEs = myDS->InterfVE(); - aNb = aVEs.Length(); + NCollection_DynamicArray& aVEs = myDS->InterfVE(); + aNb = aVEs.Length(); for (i = 0; i != aNb; ++i) { const BOPDS_InterfVE& aVE = aVEs(i); @@ -238,8 +238,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 2 - NCollection_Vector& aEEs = myDS->InterfEE(); - aNb = aEEs.Length(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + aNb = aEEs.Length(); for (i = 0; i != aNb; ++i) { const BOPDS_InterfEE& aEE = aEEs(i); @@ -253,8 +253,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 3 - NCollection_Vector& aVFs = myDS->InterfVF(); - aNb = aVFs.Length(); + NCollection_DynamicArray& aVFs = myDS->InterfVF(); + aNb = aVFs.Length(); for (i = 0; i != aNb; ++i) { const BOPDS_InterfVF& aVF = aVFs(i); @@ -268,8 +268,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 4 - NCollection_Vector& aEFs = myDS->InterfEF(); - aNb = aEFs.Length(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); + aNb = aEFs.Length(); for (i = 0; i != aNb; ++i) { const BOPDS_InterfEF& aEF = aEFs(i); @@ -287,8 +287,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 5 - NCollection_Vector& aFFs = myDS->InterfFF(); - aNb = aFFs.Length(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + aNb = aFFs.Length(); for (i = 0; i != aNb; ++i) { bool bTangentFaces, bFlag; @@ -297,10 +297,10 @@ void BOPAlgo_CheckerSI::PostTreat() const BOPDS_InterfFF& aFF = aFFs(i); aFF.Indices(n1, n2); // - bTangentFaces = aFF.TangentFaces(); - aNbP = aFF.Points().Length(); - const NCollection_Vector& aVC = aFF.Curves(); - aNbC = aVC.Length(); + bTangentFaces = aFF.TangentFaces(); + aNbP = aFF.Points().Length(); + const NCollection_DynamicArray& aVC = aFF.Curves(); + aNbC = aVC.Length(); if (!aNbP && !aNbC && !bTangentFaces) { continue; @@ -346,8 +346,8 @@ void BOPAlgo_CheckerSI::PostTreat() // // // 6 - NCollection_Vector& aVZs = myDS->InterfVZ(); - aNb = aVZs.Length(); + NCollection_DynamicArray& aVZs = myDS->InterfVZ(); + aNb = aVZs.Length(); for (i = 0; i != aNb; ++i) { // @@ -362,8 +362,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 7 - NCollection_Vector& aEZs = myDS->InterfEZ(); - aNb = aEZs.Length(); + NCollection_DynamicArray& aEZs = myDS->InterfEZ(); + aNb = aEZs.Length(); for (i = 0; i != aNb; ++i) { // @@ -374,8 +374,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 8 - NCollection_Vector& aFZs = myDS->InterfFZ(); - aNb = aFZs.Length(); + NCollection_DynamicArray& aFZs = myDS->InterfFZ(); + aNb = aFZs.Length(); for (i = 0; i != aNb; ++i) { // @@ -386,8 +386,8 @@ void BOPAlgo_CheckerSI::PostTreat() } // // 9 - NCollection_Vector& aZZs = myDS->InterfZZ(); - aNb = aZZs.Length(); + NCollection_DynamicArray& aZZs = myDS->InterfZZ(); + aNb = aZZs.Length(); for (i = 0; i != aNb; ++i) { // diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI_1.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI_1.cxx index df581f9177..09e97a4c78 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_CheckerSI_1.cxx @@ -30,7 +30,7 @@ #include -#include +#include #include #include #include @@ -122,7 +122,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfVertexSolid; +typedef NCollection_DynamicArray BOPAlgo_VectorOfVertexSolid; ///////////////////////////////////////////////////////////////////////// //================================================================================================= @@ -193,7 +193,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfShapeSolid; +typedef NCollection_DynamicArray BOPAlgo_VectorOfShapeSolid; ///////////////////////////////////////////////////////////////////////// //================================================================================================= @@ -230,7 +230,7 @@ public: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfSolidSolid; +typedef NCollection_DynamicArray BOPAlgo_VectorOfSolidSolid; //================================================================================================= @@ -249,7 +249,7 @@ void BOPAlgo_CheckerSI::PerformVZ(const Message_ProgressRange& theRange) return; } // - NCollection_Vector& aVZs = myDS->InterfVZ(); + NCollection_DynamicArray& aVZs = myDS->InterfVZ(); aVZs.SetIncrement(iSize); // BOPAlgo_VectorOfVertexSolid aVVS; @@ -376,7 +376,7 @@ void BOPAlgo_CheckerSI::PerformZZ(const Message_ProgressRange& theRange) return; } // - NCollection_Vector& aZZs = myDS->InterfZZ(); + NCollection_DynamicArray& aZZs = myDS->InterfZZ(); // aZZs.SetIncrement(iSize); // @@ -442,8 +442,8 @@ void BOPAlgo_CheckerSI::PerformSZ(const TopAbs_ShapeEnum theTS, return; } // - NCollection_Vector& aEZs = myDS->InterfEZ(); - NCollection_Vector& aFZs = myDS->InterfFZ(); + NCollection_DynamicArray& aEZs = myDS->InterfEZ(); + NCollection_DynamicArray& aFZs = myDS->InterfFZ(); // if (theTS == TopAbs_EDGE) { diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller.hxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller.hxx index 6bdfb082a9..c26466e588 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller.hxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -275,8 +275,8 @@ protected: NCollection_DataMap& theMVTol, NCollection_DataMap>& theDMVLV); - Standard_EXPORT void FilterPavesOnCurves(const NCollection_Vector& theVNC, - NCollection_DataMap& theMVTol); + Standard_EXPORT void FilterPavesOnCurves(const NCollection_DynamicArray& theVNC, + NCollection_DataMap& theMVTol); //! Depending on the parameter aType it checks whether //! the vertex nV was created in EE or EF intersections. @@ -347,7 +347,7 @@ protected: NCollection_List& aListOfPnts); //! Checks and puts paves created in EF intersections on the curve . - Standard_EXPORT void PutEFPavesOnCurve(const NCollection_Vector& theVC, + Standard_EXPORT void PutEFPavesOnCurve(const NCollection_DynamicArray& theVC, const int theIndex, const NCollection_Map& theMI, const NCollection_Map& theMVEF, @@ -359,7 +359,7 @@ protected: const TopoDS_Face& aF1, const TopoDS_Face& aF2, const NCollection_Map& theMI, - const NCollection_Vector& theVC, + const NCollection_DynamicArray& theVC, const int theIndex, const NCollection_Map& theMVStick, NCollection_DataMap& theMVTol, @@ -382,8 +382,8 @@ protected: //! Removes indices of vertices that are already on the //! curve from the map . //! It is used in PutEFPavesOnCurve and PutStickPavesOnCurve methods. - Standard_EXPORT void RemoveUsedVertices(const NCollection_Vector& theVC, - NCollection_Map& theMV); + Standard_EXPORT void RemoveUsedVertices(const NCollection_DynamicArray& theVC, + NCollection_Map& theMV); //! Puts the pave nV on the curve theNC. //! Parameter aType defines whether to check the pave with diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 016dbe2841..7707146b5c 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange) return; } // - NCollection_Vector& aVVs = myDS->InterfVV(); + NCollection_DynamicArray& aVVs = myDS->InterfVV(); aVVs.SetIncrement(aSize); // //-----------------------------------------------------scope f @@ -184,7 +184,7 @@ int BOPAlgo_PaveFiller::MakeSDVertices(const NCollection_List& theVertIndic aBox.SetGap(BRep_Tool::Tolerance(aVn) + Precision::Confusion()); // // Fill ShapesSD - NCollection_Vector& aVVs = myDS->InterfVV(); + NCollection_DynamicArray& aVVs = myDS->InterfVV(); if (theAddInterfs) aVVs.SetIncrement(theVertIndices.Extent()); // diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx index 62f54ebe22..df9f228265 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx @@ -173,7 +173,7 @@ void BOPAlgo_PaveFiller::UpdateCommonBlocksWithSDVertices() } int aNbPBP; // - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); aNbPBP = aPBP.Length(); if (!aNbPBP) @@ -219,7 +219,7 @@ namespace //================================================================================================= template -void UpdateIntfsWithSDVertices(BOPDS_PDS theDS, NCollection_Vector& theInterfs) +void UpdateIntfsWithSDVertices(BOPDS_PDS theDS, NCollection_DynamicArray& theInterfs) { for (int i = 0; i < theInterfs.Length(); i++) { diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index b60807f810..2657c2752d 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -134,7 +134,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfVertexEdge; +typedef NCollection_DynamicArray BOPAlgo_VectorOfVertexEdge; //================================================================================================= @@ -218,7 +218,7 @@ void BOPAlgo_PaveFiller::IntersectVE( return; } // - NCollection_Vector& aVEs = myDS->InterfVE(); + NCollection_DynamicArray& aVEs = myDS->InterfVE(); if (theAddInterfs) { aVEs.SetIncrement(aNbVE); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index 98a42a410e..a01ad3bd94 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -138,7 +138,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfEdgeEdge; +typedef NCollection_DynamicArray BOPAlgo_VectorOfEdgeEdge; //================================================================================================= @@ -175,7 +175,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) aMVCPB(100, aAllocator); BOPAlgo_DataMapOfPaveBlockBndBox aDMPBBox(100, aAllocator); // - NCollection_Vector& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); aEEs.SetIncrement(iSize); // for (; myIterator->More(); myIterator->Next()) @@ -608,8 +608,8 @@ void BOPAlgo_PaveFiller::PerformNewVertices( TreatNewVertices(theMVCPB, aImages); // // 2. Add new vertices to myDS and connect indices to CPB structure - NCollection_Vector& aEEs = myDS->InterfEE(); - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); // // 4. Compute Extra Paves and split Pave blocks by the Extra paves Message_ProgressScope aPS(theRange, nullptr, 2); @@ -856,7 +856,7 @@ bool BOPAlgo_PaveFiller::ForceInterfVE(const int nV, BOPDS_Pave aPave; // // - NCollection_Vector& aVEs = myDS->InterfVE(); + NCollection_DynamicArray& aVEs = myDS->InterfVE(); aVEs.SetIncrement(10); // 1 BOPDS_InterfVE& aVE = aVEs.Appended(); @@ -947,7 +947,7 @@ void BOPAlgo_PaveFiller::UpdateVerticesOfCB() // Fence map to avoid checking same Common block twice NCollection_Map> aMPBFence; - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); const int aNbPBP = aPBP.Length(); for (int i = 0; i < aNbPBP; ++i) @@ -1202,7 +1202,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) { return; } - NCollection_Vector& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); if (aEEs.IsEmpty()) aEEs.SetIncrement(10); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index edda798dc0..8c2be73f4c 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -132,7 +132,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfVertexFace; +typedef NCollection_DynamicArray BOPAlgo_VectorOfVertexFace; //================================================================================================= @@ -159,7 +159,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) return; } // - NCollection_Vector& aVFs = myDS->InterfVF(); + NCollection_DynamicArray& aVFs = myDS->InterfVF(); if (!iSize) { iSize = 10; @@ -316,8 +316,8 @@ void BOPAlgo_PaveFiller::TreatVerticesEE() // aNbS = myDS->NbSourceShapes(); // - NCollection_Vector& aEEs = myDS->InterfEE(); - aNbEEs = aEEs.Length(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + aNbEEs = aEEs.Length(); for (i = 0; i < aNbEEs; ++i) { BOPDS_InterfEE& aEE = aEEs(i); @@ -351,7 +351,7 @@ void BOPAlgo_PaveFiller::TreatVerticesEE() return; } //------------------------------------------------------------- - NCollection_Vector& aVFs = myDS->InterfVF(); + NCollection_DynamicArray& aVFs = myDS->InterfVF(); // BOPDS_SubIterator aIt(aAllocator); // diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index f8a187e7ff..9aba878ef0 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -158,7 +158,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfEdgeFace; +typedef NCollection_DynamicArray BOPAlgo_VectorOfEdgeFace; //================================================================================================= @@ -213,7 +213,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) aAllocator); BOPAlgo_DataMapOfPaveBlockBndBox aDMPBBox(100, aAllocator); // - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); aEFs.SetIncrement(iSize); // for (; myIterator->More(); myIterator->Next()) @@ -635,7 +635,7 @@ bool BOPAlgo_PaveFiller::ForceInterfVF(const int nV, const int nF) { bRet = !bRet; // - NCollection_Vector& aVFs = myDS->InterfVF(); + NCollection_DynamicArray& aVFs = myDS->InterfVF(); aVFs.SetIncrement(10); // 1 BOPDS_InterfVF& aVF = aVFs.Appended(); @@ -691,8 +691,8 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const int theV1, return; } // - NCollection_Vector& aEEs = myDS->InterfEE(); - int aNbEEs = aEEs.Length(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + int aNbEEs = aEEs.Length(); if (!aNbEEs) { return; @@ -1082,7 +1082,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF( return; } - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); if (theAddInterf && aEFs.IsEmpty()) aEFs.SetIncrement(10); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index c5627b3651..ad5c8e3bde 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -278,7 +278,7 @@ protected: //================================================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfFaceFace; +typedef NCollection_DynamicArray BOPAlgo_VectorOfFaceFace; //================================================================================================= @@ -320,7 +320,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) Message_ProgressScope aPSOuter(theRange, nullptr, 1); - NCollection_Vector& aFFs = myDS->InterfFF(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); aFFs.SetIncrement(iSize); // // Options for the intersection algorithm @@ -333,7 +333,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) // Collect all pairs of Edge/Edge interferences to check if // some faces have to be moved to obtain more precise intersection NCollection_DataMap> aEEMap; - const NCollection_Vector& aVEEs = myDS->InterfEE(); + const NCollection_DynamicArray& aVEEs = myDS->InterfEE(); for (int iEE = 0; iEE < aVEEs.Length(); ++iEE) { const BOPDS_Interf& aEE = aVEEs(iEE); @@ -587,7 +587,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) aBoxExpandValue += aMaxVertexTol; } // - NCollection_Vector& aVNC = aFF.ChangeCurves(); + NCollection_DynamicArray& aVNC = aFF.ChangeCurves(); for (int i = 1; i <= aNbCurves; ++i) { if (UserBreak(aPSOuter)) @@ -609,7 +609,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) } // // Points - NCollection_Vector& aVNP = aFF.ChangePoints(); + NCollection_DynamicArray& aVNP = aFF.ChangePoints(); for (int i = 1; i <= aNbPoints; ++i) { const IntTools_PntOn2Faces& aPi = aPntsX(i); @@ -652,9 +652,9 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) return; } // - NCollection_Vector& aFFs = myDS->InterfFF(); - int aNbFF = aFFs.Length(); - Message_ProgressScope aPS(aPSOuter.Next(), "Building section edges", aNbFF); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + int aNbFF = aFFs.Length(); + Message_ProgressScope aPS(aPSOuter.Next(), "Building section edges", aNbFF); if (!aNbFF) { return; @@ -715,7 +715,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap(100, aAllocator); // // The vector aFFToRecheck contains indices of potentially problematic Face-Face intersections - NCollection_Vector aFFToRecheck; + NCollection_DynamicArray aFFToRecheck; // aNbFF may be increased while processing this loop, because it is necessary to recheck // some of Face-Face intersections to avoid missing section edges // aNbFF will be increased to the number of potentially problematic Face-Face intersections @@ -733,10 +733,10 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) BOPDS_InterfFF& aFF = aFFs(aCurInd); aFF.Indices(nF1, nF2); // - NCollection_Vector& aVP = aFF.ChangePoints(); - aNbP = aVP.Length(); - NCollection_Vector& aVC = aFF.ChangeCurves(); - aNbC = aVC.Length(); + NCollection_DynamicArray& aVP = aFF.ChangePoints(); + aNbP = aVP.Length(); + NCollection_DynamicArray& aVC = aFF.ChangeCurves(); + aNbC = aVC.Length(); if (!aNbP && !aNbC) { continue; @@ -1182,8 +1182,8 @@ void BOPAlgo_PaveFiller::PostTreatFF( aPF.SetIsPrimary(false); aPF.SetNonDestructive(myNonDestructive); // - NCollection_Vector& aFFs = myDS->InterfFF(); - int aNbFF = aFFs.Length(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + int aNbFF = aFFs.Length(); // // Find unused vertices @@ -1197,7 +1197,7 @@ void BOPAlgo_PaveFiller::PostTreatFF( NCollection_Map aMV, aMVEF, aMI; GetStickVertices(nF1, nF2, aMV, aMVEF, aMI); - NCollection_Vector& aVC = aFF.ChangeCurves(); + NCollection_DynamicArray& aVC = aFF.ChangeCurves(); RemoveUsedVertices(aVC, aMV); NCollection_Map::Iterator itmap(aMV); @@ -1228,11 +1228,11 @@ void BOPAlgo_PaveFiller::PostTreatFF( aSI.SetShape(aS); iV = myDS->Append(aSI); // - iX = aCPB.IndexInterf(); - iP = aCPB.Index(); - BOPDS_InterfFF& aFF = aFFs(iX); - NCollection_Vector& aVNP = aFF.ChangePoints(); - BOPDS_Point& aNP = aVNP(iP); + iX = aCPB.IndexInterf(); + iP = aCPB.Index(); + BOPDS_InterfFF& aFF = aFFs(iX); + NCollection_DynamicArray& aVNP = aFF.ChangePoints(); + BOPDS_Point& aNP = aVNP(iP); aNP.SetIndex(iV); } else if (aType == TopAbs_EDGE) @@ -1421,12 +1421,12 @@ void BOPAlgo_PaveFiller::PostTreatFF( else { // update FF interference - const BOPDS_CoupleOfPaveBlocks& aCPB = theMSCPB.FindFromKey(aSx); - iX = aCPB.IndexInterf(); - iP = aCPB.Index(); - BOPDS_InterfFF& aFF = aFFs(iX); - NCollection_Vector& aVNP = aFF.ChangePoints(); - BOPDS_Point& aNP = aVNP(iP); + const BOPDS_CoupleOfPaveBlocks& aCPB = theMSCPB.FindFromKey(aSx); + iX = aCPB.IndexInterf(); + iP = aCPB.Index(); + BOPDS_InterfFF& aFF = aFFs(iX); + NCollection_DynamicArray& aVNP = aFF.ChangePoints(); + BOPDS_Point& aNP = aVNP(iP); aNP.SetIndex(iV); } } // if (aType==TopAbs_VERTEX) { @@ -1464,7 +1464,7 @@ void BOPAlgo_PaveFiller::PostTreatFF( else { BOPDS_InterfFF& aFF = aFFs(iX); - NCollection_Vector& aVNC = aFF.ChangeCurves(); + NCollection_DynamicArray& aVNC = aFF.ChangeCurves(); BOPDS_Curve& aNC = aVNC(iC); NCollection_List>& aLPBC = aNC.ChangePaveBlocks(); // @@ -1648,8 +1648,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo( // Unify pave blocks of the existing edges united on the post-treat stage NCollection_DataMap>> anEdgeLPB; - NCollection_Vector& aFFs = myDS->InterfFF(); - aNbFF = aFFs.Length(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + aNbFF = aFFs.Length(); // 1. Sections (curves, points); for (i = 0; i < aNbFF; ++i) { @@ -1660,8 +1660,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo( BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2); // // 1.1. Section edges - NCollection_Vector& aVNC = aFF.ChangeCurves(); - aNbC = aVNC.Length(); + NCollection_DynamicArray& aVNC = aFF.ChangeCurves(); + aNbC = aVNC.Length(); for (j = 0; j < aNbC; ++j) { BOPDS_Curve& aNC = aVNC(j); @@ -1707,8 +1707,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo( } // // 1.2. Section vertices - const NCollection_Vector& aVNP = aFF.Points(); - aNbP = aVNP.Length(); + const NCollection_DynamicArray& aVNP = aFF.Points(); + aNbP = aVNP.Length(); for (j = 0; j < aNbP; ++j) { const BOPDS_Point& aNP = aVNP(j); @@ -2353,8 +2353,8 @@ struct PaveBlockDist }; } // namespace -void BOPAlgo_PaveFiller::FilterPavesOnCurves(const NCollection_Vector& theVNC, - NCollection_DataMap& theMVTol) +void BOPAlgo_PaveFiller::FilterPavesOnCurves(const NCollection_DynamicArray& theVNC, + NCollection_DataMap& theMVTol) { // For each vertex found in ExtPaves of pave blocks of section curves // collect list of pave blocks with distance to the curve @@ -2482,8 +2482,8 @@ bool BOPAlgo_PaveFiller::ExtendedTolerance(const int nV, aV = (*(TopoDS_Vertex*)(&myDS->Shape(nV))); aPV = BRep_Tool::Pnt(aV); // - NCollection_Vector& aEEs = myDS->InterfEE(); - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); // for (; k < aNbInt; ++k) { @@ -2530,8 +2530,8 @@ void BOPAlgo_PaveFiller::GetEFPnts(const int nF1, GetFullShapeMap(nF1, aMI); GetFullShapeMap(nF2, aMI); // - NCollection_Vector& aEFs = myDS->InterfEF(); - aNbEFs = aEFs.Length(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); + aNbEFs = aEFs.Length(); // for (i = 0; i < aNbEFs; ++i) { @@ -2602,11 +2602,11 @@ void BOPAlgo_PaveFiller::GetEFPnts(const int nF1, //================================================================================================= -void BOPAlgo_PaveFiller::PutEFPavesOnCurve(const NCollection_Vector& theVC, - const int theIndex, - const NCollection_Map& aMI, - const NCollection_Map& aMVEF, - NCollection_DataMap& aMVTol, +void BOPAlgo_PaveFiller::PutEFPavesOnCurve(const NCollection_DynamicArray& theVC, + const int theIndex, + const NCollection_Map& aMI, + const NCollection_Map& aMVEF, + NCollection_DataMap& aMVTol, NCollection_DataMap>& aDMVLV) { if (!aMVEF.Extent()) @@ -2662,7 +2662,7 @@ void BOPAlgo_PaveFiller::PutStickPavesOnCurve( const TopoDS_Face& aF1, const TopoDS_Face& aF2, const NCollection_Map& aMI, - const NCollection_Vector& theVC, + const NCollection_DynamicArray& theVC, const int theIndex, const NCollection_Map& aMVStick, NCollection_DataMap& aMVTol, @@ -2763,11 +2763,11 @@ void BOPAlgo_PaveFiller::GetStickVertices(const int nF1, { int nS1, nS2, nVNew, aTypeInt, i; // - NCollection_Vector& aVVs = myDS->InterfVV(); - NCollection_Vector& aVEs = myDS->InterfVE(); - NCollection_Vector& aEEs = myDS->InterfEE(); - NCollection_Vector& aVFs = myDS->InterfVF(); - NCollection_Vector& aEFs = myDS->InterfEF(); + NCollection_DynamicArray& aVVs = myDS->InterfVV(); + NCollection_DynamicArray& aVEs = myDS->InterfVE(); + NCollection_DynamicArray& aEEs = myDS->InterfEE(); + NCollection_DynamicArray& aVFs = myDS->InterfVF(); + NCollection_DynamicArray& aEFs = myDS->InterfEF(); // int aNbLines[5] = {aVVs.Length(), aVEs.Length(), aEEs.Length(), aVFs.Length(), aEFs.Length()}; // collect indices of all shapes from nF1 and nF2. @@ -2836,8 +2836,8 @@ void BOPAlgo_PaveFiller::GetFullShapeMap(const int nF, NCollection_Map& aMI //================================================================================================= -void BOPAlgo_PaveFiller::RemoveUsedVertices(const NCollection_Vector& aVC, - NCollection_Map& aMV) +void BOPAlgo_PaveFiller::RemoveUsedVertices(const NCollection_DynamicArray& aVC, + NCollection_Map& aMV) { if (aMV.IsEmpty()) return; @@ -3088,9 +3088,9 @@ void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks( NCollection_List::Iterator aItLI; NCollection_DataMap>::Iterator aItBV; // - NCollection_Vector& aFFs = myDS->InterfFF(); - BOPDS_InterfFF& aFF = aFFs(theInt); - NCollection_Vector& aVC = aFF.ChangeCurves(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + BOPDS_InterfFF& aFF = aFFs(theInt); + NCollection_DynamicArray& aVC = aFF.ChangeCurves(); // const BOPDS_FaceInfo& aFI1 = myDS->FaceInfo(nF1); const BOPDS_FaceInfo& aFI2 = myDS->FaceInfo(nF2); @@ -3574,13 +3574,13 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks(const NCollection_DataMap& a NCollection_List> anAllPBs; // Get pave blocks of section edges - NCollection_Vector& aFFs = myDS->InterfFF(); - int aNbFF = aFFs.Length(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + int aNbFF = aFFs.Length(); for (i = 0; i < aNbFF; ++i) { - const BOPDS_InterfFF& aFF = aFFs(i); - const NCollection_Vector& aVNC = aFF.Curves(); - int aNbC = aVNC.Length(); + const BOPDS_InterfFF& aFF = aFFs(i); + const NCollection_DynamicArray& aVNC = aFF.Curves(); + int aNbC = aVNC.Length(); for (j = 0; j < aNbC; ++j) { const BOPDS_Curve& aNC = aVNC(j); @@ -3592,7 +3592,7 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks(const NCollection_DataMap& a } // Get pave blocks from the pool - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); aNbPBP = aPBP.Length(); for (i = 0; i < aNbPBP; ++i) @@ -3688,7 +3688,7 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const NCollection_Map& theEdges) // Remove all pave blocks referring to input edges: // // 1. from the Pave Blocks Pool - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); int aNbPBP = aPBP.Length(), i; for (i = 0; i < aNbPBP; ++i) @@ -3707,15 +3707,15 @@ void BOPAlgo_PaveFiller::RemovePaveBlocks(const NCollection_Map& theEdges) } // 2. from section curves - NCollection_Map aMPassed; - NCollection_Vector& aFFs = myDS->InterfFF(); - int aNbFF = aFFs.Length(), j; + NCollection_Map aMPassed; + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + int aNbFF = aFFs.Length(), j; for (i = 0; i < aNbFF; ++i) { BOPDS_InterfFF& aFF = aFFs(i); // remove from Section pave blocks - NCollection_Vector& aVNC = aFF.ChangeCurves(); - int aNbC = aVNC.Length(); + NCollection_DynamicArray& aVNC = aFF.ChangeCurves(); + int aNbC = aVNC.Length(); for (j = 0; j < aNbC; ++j) { BOPDS_Curve& aNC = aVNC(j); @@ -3807,8 +3807,8 @@ void BOPAlgo_PaveFiller::UpdateBlocksWithSharedVertices() // int aNbFF; // - NCollection_Vector& aFFs = myDS->InterfFF(); - aNbFF = aFFs.Length(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + aNbFF = aFFs.Length(); if (!aNbFF) { return; @@ -3823,8 +3823,8 @@ void BOPAlgo_PaveFiller::UpdateBlocksWithSharedVertices() { BOPDS_InterfFF& aFF = aFFs(i); // - NCollection_Vector& aVC = aFF.ChangeCurves(); - aNbC = aVC.Length(); + NCollection_DynamicArray& aVC = aFF.ChangeCurves(); + aNbC = aVC.Length(); if (!aNbC) { continue; @@ -3926,7 +3926,7 @@ bool BOPAlgo_PaveFiller::EstimatePaveOnCurve(const int nV, void BOPAlgo_PaveFiller::CorrectToleranceOfSE() { - NCollection_Vector& aFFs = myDS->InterfFF(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); NCollection_IndexedDataMap>> aMVIPBs; NCollection_Map aMVIToReduce; // Fence map to avoid repeated checking of the same edge @@ -3938,8 +3938,8 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() { BOPDS_InterfFF& aFF = aFFs(i); // - NCollection_Vector& aVNC = aFF.ChangeCurves(); - int aNbC = aVNC.Length(), k; + NCollection_DynamicArray& aVNC = aFF.ChangeCurves(); + int aNbC = aVNC.Length(), k; for (k = 0; k < aNbC; ++k) { BOPDS_Curve& aNC = aVNC(k); @@ -4019,8 +4019,8 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE() // reducing the tolerance to the value less than the tolerances of edges, // i.e. minimal tolerance for the vertex is the max tolerance of the // edges containing this vertex - NCollection_DataMap aMVITol; - NCollection_Vector>>& aPBP = + NCollection_DataMap aMVITol; + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); aNb = aPBP.Length(); for (i = 0; i < aNb; ++i) @@ -4137,13 +4137,13 @@ void BOPAlgo_PaveFiller::PutSEInOtherFaces(const Message_ProgressRange& theRange // Get all section edges NCollection_IndexedMap> aMPBScAll; - NCollection_Vector& aFFs = myDS->InterfFF(); - const int aNbFF = aFFs.Length(); - Message_ProgressScope aPS(theRange, nullptr, 1); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + const int aNbFF = aFFs.Length(); + Message_ProgressScope aPS(theRange, nullptr, 1); for (int i = 0; i < aNbFF; ++i) { - const NCollection_Vector& aVNC = aFFs(i).Curves(); - const int aNbC = aVNC.Length(); + const NCollection_DynamicArray& aVNC = aFFs(i).Curves(); + const int aNbC = aVNC.Length(); for (int j = 0; j < aNbC; ++j) { const NCollection_List>& aLPBC = aVNC(j).PaveBlocks(); @@ -4168,7 +4168,7 @@ void BOPAlgo_PaveFiller::RemoveMicroSectionEdges( return; // Get all F/F interferences - NCollection_Vector& aFFs = myDS->InterfFF(); + NCollection_DynamicArray& aFFs = myDS->InterfFF(); // Build the new map of section edges avoiding the micro edges NCollection_IndexedDataMap @@ -4241,7 +4241,7 @@ void BOPAlgo_PaveFiller::RemoveMicroEdges() // Resulting map of micro edges NCollection_Map aMicroEdges; // Check all pave blocks from the pool to find the micro edges - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); int aNbPBP = aPBP.Length(); for (int i = 0; i < aNbPBP; ++i) diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx index 03317fb6ee..b1b727d35d 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -160,7 +160,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfSplitEdge; +typedef NCollection_DynamicArray BOPAlgo_VectorOfSplitEdge; //================================================================================================= @@ -305,7 +305,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfMPC; +typedef NCollection_DynamicArray BOPAlgo_VectorOfMPC; //================================================================================================= @@ -356,13 +356,13 @@ private: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfBPC; +typedef NCollection_DynamicArray BOPAlgo_VectorOfBPC; //================================================================================================= void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange) { - NCollection_Vector>>& aPBP = + NCollection_DynamicArray>>& aPBP = myDS->ChangePaveBlocksPool(); int aNbPBP = aPBP.Length(); Message_ProgressScope aPSOuter(theRange, nullptr, 1); @@ -585,7 +585,7 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) BOPAlgo_VectorOfMPC aVMPC; // // 1. Process Common Blocks - const NCollection_Vector& aFIP = myDS->FaceInfoPool(); + const NCollection_DynamicArray& aFIP = myDS->FaceInfoPool(); // aNbFI = aFIP.Length(); for (i = 0; i < aNbFI; ++i) @@ -692,14 +692,14 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) if (bPCurveOnS[0] || bPCurveOnS[1]) { // container to remember already added edge-face pairs - NCollection_Map anEFPairs; - NCollection_Vector& aFFs = myDS->InterfFF(); - aNbFF = aFFs.Length(); + NCollection_Map anEFPairs; + NCollection_DynamicArray& aFFs = myDS->InterfFF(); + aNbFF = aFFs.Length(); for (i = 0; i < aNbFF; ++i) { - const BOPDS_InterfFF& aFF = aFFs(i); - const NCollection_Vector& aVNC = aFF.Curves(); - aNbC = aVNC.Length(); + const BOPDS_InterfFF& aFF = aFFs(i); + const NCollection_DynamicArray& aVNC = aFF.Curves(); + aNbC = aVNC.Length(); if (aNbC == 0) continue; int nF[2]; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_9.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_9.cxx index 85dff9a7dc..3f8615c1d4 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_9.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_9.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -58,7 +58,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfShrunkRange; +typedef NCollection_DynamicArray BOPAlgo_VectorOfShrunkRange; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx index d40cd68aee..3adc0d7c6c 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx @@ -34,7 +34,7 @@ #include -#include +#include #include @@ -831,7 +831,7 @@ private: //! @name Fields // clang-format on }; -typedef NCollection_Vector VectorOfFillGap; +typedef NCollection_DynamicArray VectorOfFillGap; //======================================================================= // function: RemoveFeatures diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Section.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Section.cxx index 4077efa83e..ab2544ec88 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Section.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Section.cxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -241,7 +241,7 @@ void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange) } // // 2. Common blocks between an edge and a face - const NCollection_Vector>>& aPBP = + const NCollection_DynamicArray>>& aPBP = myDS->PaveBlocksPool(); // aNb = aPBP.Length(); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx index 2b0d78fe39..e4e3faa769 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -85,7 +85,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPAlgo_VectorOfCBK; +typedef NCollection_DynamicArray BOPAlgo_VectorOfCBK; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx index 766df6930a..202894ee64 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -1214,7 +1214,7 @@ private: }; // Vector of ShapeBox -typedef NCollection_Vector BOPAlgo_VectorOfShapeBox; +typedef NCollection_DynamicArray BOPAlgo_VectorOfShapeBox; //======================================================================= // class : BOPAlgo_FillIn3DParts @@ -1353,7 +1353,7 @@ void BOPAlgo_FillIn3DParts::Perform() // 3. aIVec - faces to process. // Filter the selected faces with faces of the solid. - NCollection_Vector aIVec(256, anAlloc); + NCollection_DynamicArray aIVec(256, anAlloc); NCollection_List::Iterator aItLI(aLIFP); for (; aItLI.More(); aItLI.Next()) @@ -1557,7 +1557,7 @@ void BOPAlgo_FillIn3DParts::MakeConnexityBlock( } // Vector of solid classifiers -typedef NCollection_Vector BOPAlgo_VectorOfFillIn3DParts; +typedef NCollection_DynamicArray BOPAlgo_VectorOfFillIn3DParts; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter.cxx index 41141f167c..813459dde2 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -156,7 +156,7 @@ protected: Message_ProgressRange myRange; }; -typedef NCollection_Vector BOPAlgo_VectorOfConnexityBlock; +typedef NCollection_DynamicArray BOPAlgo_VectorOfConnexityBlock; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx index 5b78522c9c..10ebc2faba 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx @@ -387,15 +387,16 @@ bool BOPDS_DS::HasInterfSubShapes(const int theIndex1, const int theIndex2) cons //================================================================================================= -const NCollection_Vector>>& BOPDS_DS::PaveBlocksPool() - const +const NCollection_DynamicArray>>& BOPDS_DS:: + PaveBlocksPool() const { return myPaveBlocksPool; } //================================================================================================= -NCollection_Vector>>& BOPDS_DS::ChangePaveBlocksPool() +NCollection_DynamicArray>>& BOPDS_DS:: + ChangePaveBlocksPool() { return myPaveBlocksPool; } @@ -692,7 +693,7 @@ void BOPDS_DS::SetCommonBlock(const occ::handle& thePaveBlock //================================================================================================= -const NCollection_Vector& BOPDS_DS::FaceInfoPool() const +const NCollection_DynamicArray& BOPDS_DS::FaceInfoPool() const { return myFaceInfoPool; } diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.hxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.hxx index f30d39ddc3..b52481dc16 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -150,12 +150,12 @@ public: //! Selector //! Returns the information about pave blocks on source edges - Standard_EXPORT const NCollection_Vector>>& + Standard_EXPORT const NCollection_DynamicArray>>& PaveBlocksPool() const; //! Selector/Modifier //! Returns the information about pave blocks on source edges - Standard_EXPORT NCollection_Vector>>& + Standard_EXPORT NCollection_DynamicArray>>& ChangePaveBlocksPool(); //! Query @@ -208,7 +208,7 @@ public: //! Selector //! Returns the information about state of faces - Standard_EXPORT const NCollection_Vector& FaceInfoPool() const; + Standard_EXPORT const NCollection_DynamicArray& FaceInfoPool() const; //! Query //! Returns true if the shape with index theIndex has the @@ -309,43 +309,43 @@ public: //! Selector/Modifier //! Returns the collection of interferences Vertex/Vertex - NCollection_Vector& InterfVV(); + NCollection_DynamicArray& InterfVV(); //! Selector/Modifier //! Returns the collection of interferences Vertex/Edge - NCollection_Vector& InterfVE(); + NCollection_DynamicArray& InterfVE(); //! Selector/Modifier //! Returns the collection of interferences Vertex/Face - NCollection_Vector& InterfVF(); + NCollection_DynamicArray& InterfVF(); //! Selector/Modifier //! Returns the collection of interferences Edge/Edge - NCollection_Vector& InterfEE(); + NCollection_DynamicArray& InterfEE(); //! Selector/Modifier //! Returns the collection of interferences Edge/Face - NCollection_Vector& InterfEF(); + NCollection_DynamicArray& InterfEF(); //! Selector/Modifier //! Returns the collection of interferences Face/Face - NCollection_Vector& InterfFF(); + NCollection_DynamicArray& InterfFF(); //! Selector/Modifier //! Returns the collection of interferences Vertex/Solid - NCollection_Vector& InterfVZ(); + NCollection_DynamicArray& InterfVZ(); //! Selector/Modifier //! Returns the collection of interferences Edge/Solid - NCollection_Vector& InterfEZ(); + NCollection_DynamicArray& InterfEZ(); //! Selector/Modifier //! Returns the collection of interferences Face/Solid - NCollection_Vector& InterfFZ(); + NCollection_DynamicArray& InterfFZ(); //! Selector/Modifier //! Returns the collection of interferences Solid/Solid - NCollection_Vector& InterfZZ(); + NCollection_DynamicArray& InterfZZ(); //! Returns the number of types of the interferences static int NbInterfTypes(); @@ -476,29 +476,29 @@ private: void buildVertexEdgeMap(); private: - occ::handle myAllocator; - NCollection_List myArguments; - int myNbShapes; - int myNbSourceShapes; - NCollection_Vector myRanges; - NCollection_Vector myLines; - NCollection_DataMap myMapShapeIndex; - NCollection_Vector>> myPaveBlocksPool; + occ::handle myAllocator; + NCollection_List myArguments; + int myNbShapes; + int myNbSourceShapes; + NCollection_DynamicArray myRanges; + NCollection_DynamicArray myLines; + NCollection_DataMap myMapShapeIndex; + NCollection_DynamicArray>> myPaveBlocksPool; NCollection_DataMap, occ::handle> myMapPBCB; - NCollection_Vector myFaceInfoPool; + NCollection_DynamicArray myFaceInfoPool; NCollection_DataMap myShapesSD; NCollection_DataMap> myMapVE; NCollection_Map myInterfTB; - NCollection_Vector myInterfVV; - NCollection_Vector myInterfVE; - NCollection_Vector myInterfVF; - NCollection_Vector myInterfEE; - NCollection_Vector myInterfEF; - NCollection_Vector myInterfFF; - NCollection_Vector myInterfVZ; - NCollection_Vector myInterfEZ; - NCollection_Vector myInterfFZ; - NCollection_Vector myInterfZZ; + NCollection_DynamicArray myInterfVV; + NCollection_DynamicArray myInterfVE; + NCollection_DynamicArray myInterfVF; + NCollection_DynamicArray myInterfEE; + NCollection_DynamicArray myInterfEF; + NCollection_DynamicArray myInterfFF; + NCollection_DynamicArray myInterfVZ; + NCollection_DynamicArray myInterfEZ; + NCollection_DynamicArray myInterfFZ; + NCollection_DynamicArray myInterfZZ; NCollection_Map myInterfered; }; diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.lxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.lxx index 3e4b6cbae2..6e9f1f9593 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.lxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.lxx @@ -16,68 +16,68 @@ //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfVV() +inline NCollection_DynamicArray& BOPDS_DS::InterfVV() { return myInterfVV; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfVE() +inline NCollection_DynamicArray& BOPDS_DS::InterfVE() { return myInterfVE; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfVF() +inline NCollection_DynamicArray& BOPDS_DS::InterfVF() { return myInterfVF; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfEE() +inline NCollection_DynamicArray& BOPDS_DS::InterfEE() { return myInterfEE; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfEF() +inline NCollection_DynamicArray& BOPDS_DS::InterfEF() { return myInterfEF; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfFF() +inline NCollection_DynamicArray& BOPDS_DS::InterfFF() { return myInterfFF; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfVZ() +inline NCollection_DynamicArray& BOPDS_DS::InterfVZ() { return myInterfVZ; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfEZ() +inline NCollection_DynamicArray& BOPDS_DS::InterfEZ() { return myInterfEZ; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfFZ() +inline NCollection_DynamicArray& BOPDS_DS::InterfFZ() { return myInterfFZ; } //================================================================================================= -inline NCollection_Vector& BOPDS_DS::InterfZZ() +inline NCollection_DynamicArray& BOPDS_DS::InterfZZ() { return myInterfZZ; } diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Interf.hxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Interf.hxx index c88d370de5..3182aeb1a5 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Interf.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Interf.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -569,7 +569,7 @@ public: * @return * intersection curves */ - const NCollection_Vector& Curves() const { return myCurves; } + const NCollection_DynamicArray& Curves() const { return myCurves; } // /** @@ -578,7 +578,7 @@ public: * @return * intersection curves */ - NCollection_Vector& ChangeCurves() { return myCurves; } + NCollection_DynamicArray& ChangeCurves() { return myCurves; } // /** @@ -587,7 +587,7 @@ public: * @return * intersection points */ - const NCollection_Vector& Points() const { return myPoints; } + const NCollection_DynamicArray& Points() const { return myPoints; } // /** @@ -596,13 +596,13 @@ public: * @return * intersection points */ - NCollection_Vector& ChangePoints() { return myPoints; } + NCollection_DynamicArray& ChangePoints() { return myPoints; } // protected: - bool myTangentFaces; - NCollection_Vector myCurves; - NCollection_Vector myPoints; + bool myTangentFaces; + NCollection_DynamicArray myCurves; + NCollection_DynamicArray myPoints; }; /** diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx index c8d4fac07f..2a8f14b60c 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include ///////////////////////////////////////////////////////////////////////// @@ -70,7 +70,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPDS_VectorOfTSR; +typedef NCollection_DynamicArray BOPDS_VectorOfTSR; ///////////////////////////////////////////////////////////////////////// @@ -197,7 +197,7 @@ void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1, const TopAbs_Shap iX = BOPDS_Tools::TypeToInteger(aType1, aType2); if (iX >= 0) { - NCollection_Vector& aPairs = + NCollection_DynamicArray& aPairs = (myUseExt && iX < BOPDS_Iterator::NbExtInterfs()) ? myExtLists(iX) : myLists(iX); // sort interfering pairs for constant order of intersection std::stable_sort(aPairs.begin(), aPairs.end()); diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.hxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.hxx index 8e2b6042df..eb88668f1d 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.hxx @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include @@ -119,11 +119,11 @@ protected: //! @name Fields int myLength; //!< Length of the intersection vector of //! particular intersection type BOPDS_PDS myDS; //!< Data Structure - NCollection_Vector> - myLists; //!< Pairs with interfering bounding boxes - NCollection_Vector::Iterator myIterator; //!< Iterator on each interfering type - bool myRunParallel; //!< Flag for parallel processing - NCollection_Vector> + NCollection_DynamicArray> + myLists; //!< Pairs with interfering bounding boxes + NCollection_DynamicArray::Iterator myIterator; //!< Iterator on each interfering type + bool myRunParallel; //!< Flag for parallel processing + NCollection_DynamicArray> myExtLists; //!< Extra pairs of sub-shapes found after //! intersection of increased sub-shapes bool myUseExt; //!< Information flag for using the extra lists diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.hxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.hxx index 7ebd6f04f9..9451eba5c2 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.hxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -94,12 +94,12 @@ protected: //! Performs intersection of bounding boxes Standard_EXPORT virtual void Intersect(); - occ::handle myAllocator; - BOPDS_PDS myDS; - NCollection_Vector myList; - NCollection_Vector::Iterator myIterator; - NCollection_List* mySubSet1; - NCollection_List* mySubSet2; + occ::handle myAllocator; + BOPDS_PDS myDS; + NCollection_DynamicArray myList; + NCollection_DynamicArray::Iterator myIterator; + NCollection_List* mySubSet1; + NCollection_List* mySubSet2; }; #endif // _BOPDS_SubIterator_HeaderFile diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx index dae687bf2f..8a1f8f1347 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -136,7 +136,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPTools_VectorOfCPC; +typedef NCollection_DynamicArray BOPTools_VectorOfCPC; //================================================================================================= @@ -175,7 +175,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPTools_VectorOfCWT; +typedef NCollection_DynamicArray BOPTools_VectorOfCWT; //================================================================================================= @@ -223,7 +223,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPTools_VectorOfCDT; +typedef NCollection_DynamicArray BOPTools_VectorOfCDT; //================================================================================================= @@ -263,7 +263,7 @@ protected: // //======================================================================= -typedef NCollection_Vector BOPTools_VectorOfCVT; +typedef NCollection_DynamicArray BOPTools_VectorOfCVT; //================================================================================================= @@ -302,7 +302,7 @@ protected: }; //======================================================================= -typedef NCollection_Vector BOPTools_VectorOfCET; +typedef NCollection_DynamicArray BOPTools_VectorOfCET; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.hxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.hxx index 93537c39a5..50e92052d8 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Set.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include class BOPTools_Set { @@ -57,7 +57,7 @@ protected: Standard_EXPORT void Clear(); occ::handle myAllocator; - NCollection_Vector myShapes; + NCollection_DynamicArray myShapes; TopoDS_Shape myShape; int myNbShapes; size_t mySum; diff --git a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx index 7043ac8bfe..49965e1e2d 100644 --- a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx +++ b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx @@ -244,14 +244,14 @@ const NCollection_List& BRepAlgoAPI_BuilderAlgo::SectionEdges() // Intersection results const BOPDS_PDS& pDS = myDSFiller->PDS(); // Iterate on all Face/Face interferences and take section edges - NCollection_Vector& aFFs = pDS->InterfFF(); - const int aNbFF = aFFs.Length(); + NCollection_DynamicArray& aFFs = pDS->InterfFF(); + const int aNbFF = aFFs.Length(); for (int i = 0; i < aNbFF; ++i) { BOPDS_InterfFF& aFFi = aFFs(i); // Section curves between pair of faces - const NCollection_Vector& aSectionCurves = aFFi.Curves(); - const int aNbC = aSectionCurves.Length(); + const NCollection_DynamicArray& aSectionCurves = aFFi.Curves(); + const int aNbC = aSectionCurves.Length(); for (int j = 0; j < aNbC; ++j) { const BOPDS_Curve& aCurve = aSectionCurves(j); diff --git a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_Section.cxx b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_Section.cxx index c6693bf50c..7f2b25bd3a 100644 --- a/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_Section.cxx +++ b/src/ModelingAlgorithms/TKBO/BRepAlgoAPI/BRepAlgoAPI_Section.cxx @@ -281,8 +281,8 @@ bool HasAncestorFaces(const BOPAlgo_PPaveFiller& pPF, int aNbFF, i, j, nE, nF1, nF2, aNbVC; NCollection_List>::Iterator aItLPB; // - const BOPDS_PDS& pDS = pPF->PDS(); - NCollection_Vector& aFFs = pDS->InterfFF(); + const BOPDS_PDS& pDS = pPF->PDS(); + NCollection_DynamicArray& aFFs = pDS->InterfFF(); // // section edges aNbFF = aFFs.Length(); @@ -291,8 +291,8 @@ bool HasAncestorFaces(const BOPAlgo_PPaveFiller& pPF, BOPDS_InterfFF& aFFi = aFFs(i); aFFi.Indices(nF1, nF2); // - const NCollection_Vector& aVC = aFFi.Curves(); - aNbVC = aVC.Length(); + const NCollection_DynamicArray& aVC = aFFi.Curves(); + aNbVC = aVC.Length(); for (j = 0; j < aNbVC; j++) { const BOPDS_Curve& aBC = aVC(j); diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx index 2f41acc8d5..79df93de7f 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx @@ -1742,7 +1742,7 @@ reapprox:; aBox2.Add(gp_Pnt2d(aU2f, aV2f)); aBox2.Add(gp_Pnt2d(aU2l, aV2l)); - NCollection_Vector anArrayOfParameters; + NCollection_DynamicArray anArrayOfParameters; // We consider here that the intersection line is same-parameter-line anArrayOfParameters.Append(aC3d->FirstParameter()); diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx index db2ace1039..0706b6803d 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -79,10 +79,10 @@ TopoDS_Wire BRepAlgo::ConvertWire(const TopoDS_Wire& theWire, const double theAngleTol, const TopoDS_Face& theFace) { - TopoDS_Wire aResult; - double aMaxTol(0.); - const occ::handle aSurf = BRep_Tool::Surface(theFace); - NCollection_Vector vecCurve; + TopoDS_Wire aResult; + double aMaxTol(0.); + const occ::handle aSurf = BRep_Tool::Surface(theFace); + NCollection_DynamicArray vecCurve; BRepTools_WireExplorer anExpE(theWire, theFace); // Explore the edges in the current wire, in their connection order diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx index baeff87a95..d1e436a510 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx @@ -181,10 +181,10 @@ static void RemoveEdges(const TopoDS_Compound& theSourceComp, const NCollection_List& theListToRemove, TopoDS_Compound& theResultComp); -static bool FilterSectionEdges(const NCollection_Vector& theBCurves, - const TopoDS_Face& theSecPlane, - const BOPDS_PDS& theDS, - TopoDS_Compound& theResult); +static bool FilterSectionEdges(const NCollection_DynamicArray& theBCurves, + const TopoDS_Face& theSecPlane, + const BOPDS_PDS& theDS, + TopoDS_Compound& theResult); static bool GetUEdges(const int theIndex, const int theRank, @@ -328,8 +328,8 @@ void BRepFill_TrimShellCorner::Perform() // const BOPDS_PDS& theDS = aPF.PDS(); // - NCollection_Vector& aFFs = theDS->InterfFF(); - int aNbFFs = aFFs.Length(); + NCollection_DynamicArray& aFFs = theDS->InterfFF(); + int aNbFFs = aFFs.Length(); if (!SplitUEdges(myUEdges, theDS, myIntPointCrossDir, myHistMap)) { @@ -352,10 +352,10 @@ void BRepFill_TrimShellCorner::Perform() BOPDS_InterfFF& aFFi = aFFs(i); aFFi.Indices(nF1, nF2); // - NCollection_Vector& aVP = aFFi.ChangePoints(); - aNbP = aVP.Length(); - const NCollection_Vector& aVC = aFFi.Curves(); - aNbC = aVC.Length(); + NCollection_DynamicArray& aVP = aFFi.ChangePoints(); + aNbP = aVP.Length(); + const NCollection_DynamicArray& aVC = aFFi.Curves(); + aNbC = aVC.Length(); if (!aNbP && !aNbC) { if (!theDS->HasInterfSubShapes(nF1, nF2)) @@ -754,9 +754,9 @@ bool BRepFill_TrimShellCorner::MakeFacesSec(const int theIndex, const int theFaceIndex2, const int theSSInterfIndex) { - const NCollection_Vector& aFFs = theDS->InterfFF(); - const BOPDS_InterfFF& aFFi = aFFs(theSSInterfIndex); - const NCollection_Vector& aBCurves = aFFi.Curves(); + const NCollection_DynamicArray& aFFs = theDS->InterfFF(); + const BOPDS_InterfFF& aFFi = aFFs(theSSInterfIndex); + const NCollection_DynamicArray& aBCurves = aFFi.Curves(); TopoDS_Compound aSecEdges; TopoDS_Face aSecPlane; @@ -1206,7 +1206,7 @@ bool SplitUEdges( theHistMap) { - const NCollection_Vector& aVVs = theDS->InterfVV(); + const NCollection_DynamicArray& aVVs = theDS->InterfVV(); BRep_Builder aBB; int ueit = 0, upRow, lowCol, upCol; @@ -1354,7 +1354,7 @@ bool FindCommonVertex(const BOPDS_PDS& theDS, double& theParamOnE2) { - const NCollection_Vector& aEEs = theDS->InterfEE(); + const NCollection_DynamicArray& aEEs = theDS->InterfEE(); bool bvertexfound = false; TopoDS_Vertex aCommonVertex; @@ -2414,10 +2414,10 @@ void RemoveEdges(const TopoDS_Compound& theSourceComp, //================================================================================================= -bool FilterSectionEdges(const NCollection_Vector& theBCurves, - const TopoDS_Face& theSecPlane, - const BOPDS_PDS& theDS, - TopoDS_Compound& theResult) +bool FilterSectionEdges(const NCollection_DynamicArray& theBCurves, + const TopoDS_Face& theSecPlane, + const BOPDS_PDS& theDS, + TopoDS_Compound& theResult) { theResult.Nullify(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx index c75c211631..d14643e818 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -328,9 +328,9 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray& //================================================================================================= -void ApproxInt_KnotTools::FilterKnots(NCollection_Sequence& theInds, - const int theMinNbPnts, - NCollection_Vector& theLKnots) +void ApproxInt_KnotTools::FilterKnots(NCollection_Sequence& theInds, + const int theMinNbPnts, + NCollection_DynamicArray& theLKnots) { // Maximum number of points per knot interval. int aMaxNbPnts = aMaxPntCoeff * theMinNbPnts; @@ -559,7 +559,7 @@ void ApproxInt_KnotTools::BuildKnots(const NCollection_Array1& thePnts const bool theApproxU1V1, const bool theApproxU2V2, const int theMinNbPnts, - NCollection_Vector& theKnots) + NCollection_DynamicArray& theKnots) { NCollection_Sequence aKnots; int aDim = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.hxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.hxx index 80dee34547..e24c8c2530 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -69,7 +69,7 @@ public: const bool theApproxU1V1, const bool theApproxU2V2, const int theMinNbPnts, - NCollection_Vector& theKnots); + NCollection_DynamicArray& theKnots); //! Builds discrete curvature Standard_EXPORT static void BuildCurvature(const NCollection_LocalArray& theCoords, @@ -126,9 +126,9 @@ private: //! II: Filter points with too small amount of points per knot interval. //! //! III: Fill Last Knot. - static void FilterKnots(NCollection_Sequence& theInds, - const int theMinNbPnts, - NCollection_Vector& theLKnots); + static void FilterKnots(NCollection_Sequence& theInds, + const int theMinNbPnts, + NCollection_DynamicArray& theLKnots); }; #endif diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx index cf919b7aeb..ec5ae2ab60 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.cxx @@ -86,8 +86,8 @@ void GeomInt_IntSS::InternalPerform(const double Tol, occ::handle dom1 = new Adaptor3d_TopolTool(myHS1); occ::handle dom2 = new Adaptor3d_TopolTool(myHS2); - NCollection_Vector> aVecHS1; - NCollection_Vector> aVecHS2; + NCollection_DynamicArray> aVecHS1; + NCollection_DynamicArray> aVecHS2; if (myHS1 == myHS2) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.hxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.hxx index 571664b62a..ea32c256a3 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include class Geom_Surface; class Geom_Curve; @@ -155,11 +155,11 @@ public: //! points of given theC2d1 and theC2d2 curves with the boundaries //! of the source surface. Standard_EXPORT static void TrimILineOnSurfBoundaries( - const occ::handle& theC2d1, - const occ::handle& theC2d2, - const Bnd_Box2d& theBound1, - const Bnd_Box2d& theBound2, - NCollection_Vector& theArrayOfParameters); + const occ::handle& theC2d1, + const occ::handle& theC2d2, + const Bnd_Box2d& theBound1, + const Bnd_Box2d& theBound2, + NCollection_DynamicArray& theArrayOfParameters); Standard_EXPORT static occ::handle MakeBSpline(const occ::handle& WL, const int ideb, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx index 4e190b3206..13767033ea 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx @@ -170,7 +170,7 @@ static bool ParametersOfNearestPointOnSurface(const Extrema_ExtPS& theExtr, static void GetSegmentBoundary(const IntRes2d_IntersectionSegment& theSegm, const occ::handle& theCurve, - NCollection_Vector& theArrayOfParameters) + NCollection_DynamicArray& theArrayOfParameters) { double aU1 = theCurve->FirstParameter(), aU2 = theCurve->LastParameter(); @@ -196,7 +196,7 @@ static void IntersectCurveAndBoundary(const occ::handle& the const occ::handle* const theArrBounds, const int theNumberOfCurves, const double theTol, - NCollection_Vector& theArrayOfParameters) + NCollection_DynamicArray& theArrayOfParameters) { if (theC2d.IsNull()) return; @@ -1008,7 +1008,7 @@ void GeomInt_IntSS::MakeCurve(const int Index, aBox2.Add(gp_Pnt2d(aU2f, aV2f)); aBox2.Add(gp_Pnt2d(aU2l, aV2l)); - NCollection_Vector anArrayOfParameters; + NCollection_DynamicArray anArrayOfParameters; // We consider here that the intersection line is same-parameter-line anArrayOfParameters.Append(aC3d->FirstParameter()); @@ -1296,11 +1296,12 @@ void GeomInt_IntSS::BuildPCurves(const double f, // surface boundaries and fills theArrayOfParameters by parameters // along the given curves corresponding of these points. //======================================================================= -void GeomInt_IntSS::TrimILineOnSurfBoundaries(const occ::handle& theC2d1, - const occ::handle& theC2d2, - const Bnd_Box2d& theBound1, - const Bnd_Box2d& theBound2, - NCollection_Vector& theArrayOfParameters) +void GeomInt_IntSS::TrimILineOnSurfBoundaries( + const occ::handle& theC2d1, + const occ::handle& theC2d2, + const Bnd_Box2d& theBound1, + const Bnd_Box2d& theBound2, + NCollection_DynamicArray& theArrayOfParameters) { // Rectangular boundaries of two surfaces: [0]:U=Ufirst, [1]:U=Ulast, // [2]:V=Vfirst, [3]:V=Vlast diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineTool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineTool.cxx index 6193a6dc3e..50adf19fec 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineTool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineTool.cxx @@ -412,7 +412,7 @@ bool GeomInt_LineTool::DecompositionOfWLine( NCollection_Sequence>& theNewLines) { typedef NCollection_List ListOfInteger; - // have to use std::vector, not NCollection_Vector in order to use copy constructor of + // have to use std::vector, not NCollection_DynamicArray in order to use copy constructor of // ListOfInteger which will be created with specific allocator instance typedef std::vector> ArrayOfListOfInteger; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_WLApprox.hxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_WLApprox.hxx index 54555f939c..68fa6da463 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_WLApprox.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_WLApprox.hxx @@ -18,7 +18,7 @@ #define _GeomInt_WLApprox_HeaderFile #include -#include +#include #include #include #include @@ -163,7 +163,7 @@ private: double myTolReached3d; double myTolReached2d; Approx_Data myData; - NCollection_Vector myKnots; + NCollection_DynamicArray myKnots; }; #endif // _GeomInt_WLApprox_HeaderFile diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.pxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.pxx index a83d0297c1..f633962880 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.pxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.pxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -75,7 +75,7 @@ void Perform(const CurveType& theCurve, theReset(); theDone = true; - NCollection_Vector aIntervals; + NCollection_DynamicArray aIntervals; IntCurveSurface_InterUtils::DecomposeSurfaceIntervals(theSurface, aIntervals); @@ -328,7 +328,7 @@ void InternalPerformBSB(const CurveType& theCurve, aStartPoints); IntCurveSurface_InterUtils::SortStartPoints(aStartPoints); - NCollection_Vector aResultPoints; + NCollection_DynamicArray aResultPoints; IntCurveSurface_InterUtils:: ProcessSortedPoints( intersectionExacte, @@ -387,7 +387,7 @@ void InternalPerform(const CurveType& theCurve, aStartPoints); IntCurveSurface_InterUtils::SortStartPoints(aStartPoints); - NCollection_Vector aResultPoints; + NCollection_DynamicArray aResultPoints; IntCurveSurface_InterUtils:: ProcessSortedPoints( intersectionExacte, @@ -420,7 +420,7 @@ void InternalPerformCurveQuadric(const CurveType& theCurve, const SurfaceType& theSurface, AppendFunc theAppend) { - NCollection_Vector aPoints; + NCollection_DynamicArray aPoints; IntCurveSurface_InterUtils:: PerformCurveQuadric( @@ -555,7 +555,7 @@ void PerformConicSurfLine(const gp_Lin& theLine, break; } case GeomAbs_Torus: { - NCollection_Vector aPoints; + NCollection_DynamicArray aPoints; if (IntCurveSurface_InterUtils:: ProcessLinTorus(theLine, theCurve, @@ -947,8 +947,8 @@ void AppendIntAna(const CurveType& theCurve, bool& theIsParallel, AppendFunc theAppend) { - bool aIsParallel = false; - NCollection_Vector aPoints; + bool aIsParallel = false; + NCollection_DynamicArray aPoints; if (IntCurveSurface_InterUtils::ProcessIntAna( theCurve, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_InterUtils.pxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_InterUtils.pxx index 4b71ed78dd..e5d4e394b1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_InterUtils.pxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_InterUtils.pxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -1101,11 +1101,11 @@ bool ComputeAppendPoint(const CurveType& theCurve, //! @param[out] thePoints Vector of computed intersection points //! @return true if the operation was done successfully template -bool ProcessIntAna(const CurveType& theCurve, - const SurfaceType& theSurface, - const IntAna_IntConicQuad& theIntAna, - bool& theIsParallel, - NCollection_Vector& thePoints) +bool ProcessIntAna(const CurveType& theCurve, + const SurfaceType& theSurface, + const IntAna_IntConicQuad& theIntAna, + bool& theIsParallel, + NCollection_DynamicArray& thePoints) { theIsParallel = false; thePoints.Clear(); @@ -1156,9 +1156,9 @@ template -void PerformCurveQuadric(const CurveType& theCurve, - const SurfaceType& theSurface, - NCollection_Vector& thePoints) +void PerformCurveQuadric(const CurveType& theCurve, + const SurfaceType& theSurface, + NCollection_DynamicArray& thePoints) { thePoints.Clear(); @@ -1196,10 +1196,10 @@ void PerformCurveQuadric(const CurveType& //! @tparam SurfaceTool The surface tool class //! @return true if intersection was processed successfully, false if fallback is needed template -bool ProcessLinTorus(const gp_Lin& theLine, - const CurveType& theCurve, - const SurfaceType& theSurface, - NCollection_Vector& thePoints) +bool ProcessLinTorus(const gp_Lin& theLine, + const CurveType& theCurve, + const SurfaceType& theSurface, + NCollection_DynamicArray& thePoints) { thePoints.Clear(); @@ -1233,9 +1233,9 @@ bool ProcessLinTorus(const gp_Lin& theL //! Structure to hold sorted intersection start points. struct SortedStartPoints { - NCollection_Vector TabU; - NCollection_Vector TabV; - NCollection_Vector TabW; + NCollection_DynamicArray TabU; + NCollection_DynamicArray TabV; + NCollection_DynamicArray TabW; void Clear() { @@ -1371,18 +1371,18 @@ template -void ProcessSortedPoints(ExactInterType& theExactInter, - math_FunctionSetRoot& theRsnld, - const SortedStartPoints& thePoints, - const double theU0, - const double theU1, - const double theV0, - const double theV1, - const double theWinf, - const double theWsup, - const CurveType& theCurve, - const SurfaceType& theSurface, - NCollection_Vector& theResult) +void ProcessSortedPoints(ExactInterType& theExactInter, + math_FunctionSetRoot& theRsnld, + const SortedStartPoints& thePoints, + const double theU0, + const double theU1, + const double theV0, + const double theV1, + const double theWinf, + const double theWsup, + const CurveType& theCurve, + const SurfaceType& theSurface, + NCollection_DynamicArray& theResult) { theResult.Clear(); @@ -1459,8 +1459,8 @@ struct UVBounds //! @tparam SurfaceType The surface type //! @tparam SurfaceTool The surface tool class template -void DecomposeSurfaceIntervals(const SurfaceType& theSurface, - NCollection_Vector& theIntervals) +void DecomposeSurfaceIntervals(const SurfaceType& theSurface, + NCollection_DynamicArray& theIntervals) { theIntervals.Clear(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx index fe2f5f6dcd..1f33115150 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx @@ -2235,10 +2235,10 @@ double IntPatch_Intersection::DefineUVMaxStep(const occ::handle& theS, - const occ::handle& theD, - const double theTol, - NCollection_Vector>& theVecHS) +static void splitCone(const occ::handle& theS, + const occ::handle& theD, + const double theTol, + NCollection_DynamicArray>& theVecHS) { if (theS->GetType() != GeomAbs_Cone) { @@ -2273,13 +2273,13 @@ static void splitCone(const occ::handle& theS, // purpose : Prepares surfaces for intersection //======================================================================= void IntPatch_Intersection::PrepareSurfaces( - const occ::handle& theS1, - const occ::handle& theD1, - const occ::handle& theS2, - const occ::handle& theD2, - const double theTol, - NCollection_Vector>& theVecHS1, - NCollection_Vector>& theVecHS2) + const occ::handle& theS1, + const occ::handle& theD1, + const occ::handle& theS2, + const occ::handle& theD2, + const double theTol, + NCollection_DynamicArray>& theVecHS1, + NCollection_DynamicArray>& theVecHS2) { if ((theS1->GetType() == GeomAbs_Cone) && (std::abs(M_PI / 2. - std::abs(theS1->Cone().SemiAngle())) < theTol)) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.hxx index b816a8ef5e..c9be7d39c6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include class Adaptor3d_TopolTool; @@ -193,13 +193,13 @@ public: //! Prepares surfaces for intersection Standard_EXPORT static void PrepareSurfaces( - const occ::handle& theS1, - const occ::handle& theD1, - const occ::handle& theS2, - const occ::handle& theD2, - const double Tol, - NCollection_Vector>& theSeqHS1, - NCollection_Vector>& theSeqHS2); + const occ::handle& theS1, + const occ::handle& theD1, + const occ::handle& theS2, + const occ::handle& theD2, + const double Tol, + NCollection_DynamicArray>& theSeqHS1, + NCollection_DynamicArray>& theSeqHS2); private: Standard_EXPORT void ParamParamPerfom(const occ::handle& S1, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Array.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Array.hxx index 2588ff23a5..16467fdc4b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Array.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Array.hxx @@ -16,7 +16,7 @@ #ifndef IntPolyh_Array_HeaderFile #define IntPolyh_Array_HeaderFile -#include +#include #include /** @@ -24,7 +24,7 @@ * * 1. The Array is dynamic array of objects. * -* 2. The Array uses NCollection_Vector to store objects +* 2. The Array uses NCollection_DynamicArray to store objects * * 3. The Array can be created: * 3.1. with initial length Nb=0. @@ -59,7 +59,7 @@ template class IntPolyh_Array { public: - typedef NCollection_Vector IntPolyh_VectorOfType; + typedef NCollection_DynamicArray IntPolyh_VectorOfType; /** * Constructor. diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx index 595778a775..d2d7448152 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx @@ -101,7 +101,7 @@ IntWalk_IWalking::IntWalk_IWalking(const double Epsilon, //======================================================================= // function : Reset -// purpose : Clears NCollection_Vector-based containers and adds +// purpose : Clears NCollection_DynamicArray-based containers and adds // dummy data to maintain start index of 1 and consistent with // previous TCollection_Sequence-based implementation and other // used TCollection-based containers diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.hxx index 37bb03d835..cf8fa49522 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.hxx @@ -29,7 +29,7 @@ class BRepMesh_DataStructureOfDelaun; class BRepMesh_BaseMeshAlgo : public IMeshTools_MeshAlgo { public: - typedef NCollection_Shared> VectorOfPnt; + typedef NCollection_Shared> VectorOfPnt; //! Constructor. Standard_EXPORT BRepMesh_BaseMeshAlgo(); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.hxx index c1c7be25e3..2c2dd9e4a4 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.hxx @@ -56,8 +56,8 @@ public: DEFINE_STANDARD_RTTIEXT(BRepMesh_Classifier, Standard_Transient) private: - NCollection_Vector> myTabClass; - IMeshData::VectorOfBoolean myTabOrient; + NCollection_DynamicArray> myTabClass; + IMeshData::VectorOfBoolean myTabOrient; }; #endif diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx index 77ee6dc431..00f4576b6a 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.hxx index 190f218726..0864d9fb01 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.hxx @@ -51,7 +51,7 @@ public: //! @name mesher API } }; - typedef NCollection_Shared> Segments; + typedef NCollection_Shared> Segments; typedef NCollection_Shared>> ArrayOfSegments; typedef NCollection_Shared> ArrayOfBndBoxTree; typedef NCollection_Shared> diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.cxx index 2dd0816275..de6a909699 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.cxx @@ -73,7 +73,7 @@ occ::handle BRepMesh_Triangulator::ToPolyTriangulation( //================================================================================================= BRepMesh_Triangulator::BRepMesh_Triangulator( - const NCollection_Vector& theXYZs, + const NCollection_DynamicArray& theXYZs, const NCollection_List>& theWires, const gp_Dir& theNorm) : myXYZs(theXYZs), diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.hxx index 0ec47792c3..b945ff05a8 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Triangulator.hxx @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ public: public: //! Constructor. Initialized tool by the given parameters. - Standard_EXPORT BRepMesh_Triangulator(const NCollection_Vector& theXYZs, + Standard_EXPORT BRepMesh_Triangulator(const NCollection_DynamicArray& theXYZs, const NCollection_List>& theWires, const gp_Dir& theNorm); @@ -70,7 +70,7 @@ private: bool triangulate(NCollection_List& thePolyTriangles); private: - const NCollection_Vector& myXYZs; + const NCollection_DynamicArray& myXYZs; const NCollection_List>& myWires; gp_Pln myPlane; occ::handle myMess; diff --git a/src/ModelingAlgorithms/TKMesh/GTests/BRepMesh_BaseMeshAlgo_Test.cxx b/src/ModelingAlgorithms/TKMesh/GTests/BRepMesh_BaseMeshAlgo_Test.cxx index 2e1439f8c4..f4776bc67d 100644 --- a/src/ModelingAlgorithms/TKMesh/GTests/BRepMesh_BaseMeshAlgo_Test.cxx +++ b/src/ModelingAlgorithms/TKMesh/GTests/BRepMesh_BaseMeshAlgo_Test.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -190,8 +191,8 @@ TEST(BRepMesh_BaseMeshAlgoTest, MultipleInternalVertices) TopoDS_Face aFace = BRepBuilderAPI_MakeFace(aPlane, 0.0, aSize, 0.0, aSize); // Add a grid of internal vertices (5x5 = 25 vertices) - const int aGridSize = 5; - NCollection_Vector anInternalPts; + const int aGridSize = 5; + NCollection_DynamicArray anInternalPts; for (int i = 1; i < aGridSize; ++i) { for (int j = 1; j < aGridSize; ++j) diff --git a/src/ModelingAlgorithms/TKMesh/IMeshData/IMeshData_Types.hxx b/src/ModelingAlgorithms/TKMesh/IMeshData/IMeshData_Types.hxx index 7ac8d51114..00a712ef90 100644 --- a/src/ModelingAlgorithms/TKMesh/IMeshData/IMeshData_Types.hxx +++ b/src/ModelingAlgorithms/TKMesh/IMeshData/IMeshData_Types.hxx @@ -87,19 +87,19 @@ typedef NCollection_Shared> BndBox2dTree; typedef NCollection_UBTreeFiller BndBox2dTreeFiller; // Vectors -typedef NCollection_Shared> VectorOfIFaceHandles; -typedef NCollection_Shared> VectorOfIWireHandles; -typedef NCollection_Shared> VectorOfIEdgeHandles; -typedef NCollection_Shared> VectorOfIPCurveHandles; -typedef NCollection_Shared> VectorOfIEdgePtrs; -typedef NCollection_Shared> VectorOfBoolean; -typedef NCollection_Shared> VectorOfInteger; -typedef NCollection_Shared> VectorOfOrientation; -typedef NCollection_Shared> VectorOfElements; -typedef NCollection_Shared> VectorOfCircle; +typedef NCollection_Shared> VectorOfIFaceHandles; +typedef NCollection_Shared> VectorOfIWireHandles; +typedef NCollection_Shared> VectorOfIEdgeHandles; +typedef NCollection_Shared> VectorOfIPCurveHandles; +typedef NCollection_Shared> VectorOfIEdgePtrs; +typedef NCollection_Shared> VectorOfBoolean; +typedef NCollection_Shared> VectorOfInteger; +typedef NCollection_Shared> VectorOfOrientation; +typedef NCollection_Shared> VectorOfElements; +typedef NCollection_Shared> VectorOfCircle; -typedef NCollection_Shared> Array1OfVertexOfDelaun; -typedef NCollection_Shared> VectorOfVertex; +typedef NCollection_Shared> Array1OfVertexOfDelaun; +typedef NCollection_Shared> VectorOfVertex; // Sequences typedef NCollection_Shared> SequenceOfBndB2d; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx index eb9d9b69a0..41b9a636ee 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx @@ -91,7 +91,7 @@ #include #include #include -#include +#include #include // #include @@ -303,10 +303,10 @@ static bool TrimEdges( static void AppendToList(NCollection_List& theL, const TopoDS_Shape& theS); -static BRepOffset_Error checkSinglePoint(const double theUParam, - const double theVParam, - const occ::handle& theSurf, - const NCollection_Vector& theBadPoints); +static BRepOffset_Error checkSinglePoint(const double theUParam, + const double theVParam, + const occ::handle& theSurf, + const NCollection_DynamicArray& theBadPoints); //--------------------------------------------------------------------- static void UpdateTolerance( @@ -4266,8 +4266,8 @@ bool BRepOffset_MakeOffset::CheckInputData(const Message_ProgressRange& theRange } // Get degenerated points, to avoid check them. - NCollection_Vector aBad3dPnts; - TopExp_Explorer anExpFE(aF, TopAbs_EDGE); + NCollection_DynamicArray aBad3dPnts; + TopExp_Explorer anExpFE(aF, TopAbs_EDGE); for (; anExpFE.More(); anExpFE.Next()) { const TopoDS_Edge& aE = TopoDS::Edge(anExpFE.Current()); @@ -4389,10 +4389,10 @@ void BRepOffset_MakeOffset::RemoveInternalEdges() // function : checkSinglePoint // purpose : Check single point on surface for bad normals //======================================================================= -BRepOffset_Error checkSinglePoint(const double theUParam, - const double theVParam, - const occ::handle& theSurf, - const NCollection_Vector& theBadPoints) +BRepOffset_Error checkSinglePoint(const double theUParam, + const double theVParam, + const occ::handle& theSurf, + const NCollection_DynamicArray& theBadPoints) { gp_Pnt aPnt; gp_Vec aD1U, aD1V; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx index c429174b43..29f03c982a 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -4570,13 +4570,13 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections( // get shapes connections for using in the rebuilding process const BOPDS_PDS& pDS = theBuilder.PDS(); // analyze all Face/Face intersections - const NCollection_Vector& aFFs = pDS->InterfFF(); - int iInt, aNbFF = aFFs.Length(); + const NCollection_DynamicArray& aFFs = pDS->InterfFF(); + int iInt, aNbFF = aFFs.Length(); for (iInt = 0; iInt < aNbFF; ++iInt) { - const BOPDS_InterfFF& aFF = aFFs(iInt); - const NCollection_Vector& aVNC = aFF.Curves(); - int aNbC = aVNC.Length(); + const BOPDS_InterfFF& aFF = aFFs(iInt); + const NCollection_DynamicArray& aVNC = aFF.Curves(); + int aNbC = aVNC.Length(); if (!aNbC) { continue; @@ -4782,8 +4782,8 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections( continue; } - NCollection_List aLV; - const NCollection_Vector& aEFs = pDS->InterfEF(); + NCollection_List aLV; + const NCollection_DynamicArray& aEFs = pDS->InterfEF(); for (int iEF = 0; iEF < aEFs.Length(); ++iEF) { const BOPDS_InterfEF& aEF = aEFs(iEF); @@ -8471,8 +8471,8 @@ void BRepOffset_BuildOffsetFaces::GetInvalidEdgesByBounds( const BOPDS_PDS& pDS = aSec.PDS(); // // check edge/edge intersections - const NCollection_Vector& aEEs = pDS->InterfEE(); - int i, aNb = aEEs.Length(); + const NCollection_DynamicArray& aEEs = pDS->InterfEE(); + int i, aNb = aEEs.Length(); for (i = 0; i < aNb; ++i) { const BOPDS_InterfEE& aEE = aEEs(i); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx index da1f09abda..8d08f352fd 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -318,7 +318,7 @@ void BRepOffset_SimpleOffset::FillVertexData( return; // Free verices are skipped. // Array to store offset points. - NCollection_Vector anOffsetPointVec; + NCollection_DynamicArray anOffsetPointVec; double aMaxEdgeTol = 0.0; @@ -371,7 +371,7 @@ void BRepOffset_SimpleOffset::FillVertexData( aMaxEdgeTol = std::max(aMaxEdgeTol, aNED.myTol); } - // NCollection_Vector starts from 0 by default. + // NCollection_DynamicArray starts from 0 by default. // It's better to use lower() and upper() in this case instead of direct indexes range. gp_Pnt aCenter(0.0, 0.0, 0.0); for (int i = anOffsetPointVec.Lower(); i <= anOffsetPointVec.Upper(); ++i) diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx index 2f1d0e2139..3d5ada67ef 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx @@ -812,8 +812,8 @@ static bool IsAutonomVertex(const TopoDS_Shape& aVertex, const BOPDS_PDS& pDS) } // check if vertex with index "index" is not created in VV or EE or EF interference // VV - NCollection_Vector& aVVs = pDS->InterfVV(); - aNbVVs = aVVs.Length(); + NCollection_DynamicArray& aVVs = pDS->InterfVV(); + aNbVVs = aVVs.Length(); for (aInt = 0; aInt < aNbVVs; aInt++) { const BOPDS_InterfVV& aVV = aVVs(aInt); @@ -826,8 +826,8 @@ static bool IsAutonomVertex(const TopoDS_Shape& aVertex, const BOPDS_PDS& pDS) } } // EE - NCollection_Vector& aEEs = pDS->InterfEE(); - aNbEEs = aEEs.Length(); + NCollection_DynamicArray& aEEs = pDS->InterfEE(); + aNbEEs = aEEs.Length(); for (aInt = 0; aInt < aNbEEs; aInt++) { const BOPDS_InterfEE& aEE = aEEs(aInt); @@ -841,8 +841,8 @@ static bool IsAutonomVertex(const TopoDS_Shape& aVertex, const BOPDS_PDS& pDS) } } // EF - NCollection_Vector& aEFs = pDS->InterfEF(); - aNbEFs = aEFs.Length(); + NCollection_DynamicArray& aEFs = pDS->InterfEF(); + aNbEFs = aEFs.Length(); for (aInt = 0; aInt < aNbEFs; aInt++) { const BOPDS_InterfEF& aEF = aEFs(aInt); @@ -1181,9 +1181,9 @@ static void CheckIntersFF(const BOPDS_PDS& const TopoDS_Edge& RefEdge, NCollection_IndexedMap& TrueEdges) { - NCollection_Vector& aFFs = pDS->InterfFF(); - int aNb = aFFs.Length(); - int i, j, nbe = 0; + NCollection_DynamicArray& aFFs = pDS->InterfFF(); + int aNb = aFFs.Length(); + int i, j, nbe = 0; TopoDS_Compound Edges; BRep_Builder BB; @@ -1191,9 +1191,9 @@ static void CheckIntersFF(const BOPDS_PDS& for (i = 0; i < aNb; ++i) { - BOPDS_InterfFF& aFFi = aFFs(i); - const NCollection_Vector& aBCurves = aFFi.Curves(); - int aNbCurves = aBCurves.Length(); + BOPDS_InterfFF& aFFi = aFFs(i); + const NCollection_DynamicArray& aBCurves = aFFi.Curves(); + int aNbCurves = aBCurves.Length(); for (j = 0; j < aNbCurves; ++j) { @@ -1389,10 +1389,10 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, bool addPCurve1 = true; bool addPCurve2 = true; - const BOPDS_PDS& pDS = aPF.PDS(); - NCollection_Vector& aFFs = pDS->InterfFF(); - int aNb = aFFs.Length(); - int i = 0, j = 0, k; + const BOPDS_PDS& pDS = aPF.PDS(); + NCollection_DynamicArray& aFFs = pDS->InterfFF(); + int aNb = aFFs.Length(); + int i = 0, j = 0, k; // Store Result L1.Clear(); L2.Clear(); @@ -1403,8 +1403,8 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, // for (i = 0; i < aNb; i++) { - BOPDS_InterfFF& aFFi = aFFs(i); - const NCollection_Vector& aBCurves = aFFi.Curves(); + BOPDS_InterfFF& aFFi = aFFs(i); + const NCollection_DynamicArray& aBCurves = aFFi.Curves(); int aNbCurves = aBCurves.Length(); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx index b2dd26ef49..4dd732f453 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -647,9 +647,9 @@ occ::handle ShapeAnalysis_CanonicalRecognition::GetSurface( int& theStatus) { // Get surface list - NCollection_Vector> aSurfs; - NCollection_Vector aGaps; - int j = 0; + NCollection_DynamicArray> aSurfs; + NCollection_DynamicArray aGaps; + int j = 0; for (;;) { j++; @@ -731,8 +731,8 @@ occ::handle ShapeAnalysis_CanonicalRecognition::GetSurface( int& theStatus) { // Get surface list - NCollection_Vector> aSurfs; - NCollection_Vector aGaps; + NCollection_DynamicArray> aSurfs; + NCollection_DynamicArray aGaps; TopoDS_Iterator anIter(theWire); if (!anIter.More()) @@ -1195,12 +1195,12 @@ bool GetSamplePoints(const TopoDS_Wire& theWire, const int theMaxNbInt, occ::handle>& thePoints) { - NCollection_Vector aLengths; - NCollection_Vector aCurves; - NCollection_Vector aPoints; - double aTol = std::max(1.e-3, theTol / 10.); - double aTotalLength = 0.; - TopoDS_Iterator anEIter(theWire); + NCollection_DynamicArray aLengths; + NCollection_DynamicArray aCurves; + NCollection_DynamicArray aPoints; + double aTol = std::max(1.e-3, theTol / 10.); + double aTotalLength = 0.; + TopoDS_Iterator anEIter(theWire); for (; anEIter.More(); anEIter.Next()) { const TopoDS_Edge& anE = TopoDS::Edge(anEIter.Value()); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index d127d4e415..be1b510d99 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -217,8 +217,8 @@ private: private: occ::handle mySurf; //!< Surface to project on - NCollection_Vector myCorners3d; //!< 3D positions of B-spline surface corners - NCollection_Vector myCorners2d; //!< UV parameters of B-spline surface corners + NCollection_DynamicArray myCorners3d; //!< 3D positions of B-spline surface corners + NCollection_DynamicArray myCorners2d; //!< UV parameters of B-spline surface corners }; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Approx.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Approx.hxx index 8f804195a8..adaa2e6871 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Approx.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Approx.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -171,7 +171,7 @@ private: double myTolReached3d; double myTolReached2d; Approx_Data myData; - NCollection_Vector myKnots; + NCollection_DynamicArray myKnots; }; #endif // _BRepApprox_Approx_HeaderFile diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index 814fcdb4a4..72090e8205 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -539,9 +539,10 @@ double BRepBuilderAPI_FastSewing::Compute3DRange() //================================================================================================= -BRepBuilderAPI_FastSewing::NodeInspector::NodeInspector(const NCollection_Vector& theVec, - const gp_Pnt& thePnt, - const double theTol) +BRepBuilderAPI_FastSewing::NodeInspector::NodeInspector( + const NCollection_DynamicArray& theVec, + const gp_Pnt& thePnt, + const double theTol) : myVecOfVertexes(theVec), myPoint(thePnt), myResID(-1) @@ -567,9 +568,9 @@ NCollection_CellFilter_Action BRepBuilderAPI_FastSewing::NodeInspector::Inspect( //================================================================================================= void BRepBuilderAPI_FastSewing::FS_Edge::CreateTopologicalEdge( - const NCollection_Vector& theVertexVec, - const NCollection_Vector& theFaceVec, - const double theTol) + const NCollection_DynamicArray& theVertexVec, + const NCollection_DynamicArray& theFaceVec, + const double theTol) { BRep_Builder aBuilder; @@ -647,8 +648,8 @@ void BRepBuilderAPI_FastSewing::FS_Edge::CreateTopologicalEdge( //================================================================================================= void BRepBuilderAPI_FastSewing::FS_Face::CreateTopologicalWire( - const NCollection_Vector& theEdgeVec, - const double theToler) + const NCollection_DynamicArray& theEdgeVec, + const double theToler) { TopLoc_Location aLocation; // 3D-curves in 1st and 2nd faces are considered to be in same-range diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.hxx index a66476f9e6..404f9ed518 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -160,8 +160,8 @@ protected: }; //! Creates topological members (wire and face) - void CreateTopologicalWire(const NCollection_Vector& theEdgeVec, - const double theToler); + void CreateTopologicalWire(const NCollection_DynamicArray& theEdgeVec, + const double theToler); void CreateTopologicalFace(); //! Sets vertex @@ -217,9 +217,9 @@ protected: }; //! Creates topological member (TopoDS_Edge) - void CreateTopologicalEdge(const NCollection_Vector& theVertexVec, - const NCollection_Vector& theFaceVec, - const double theTol); + void CreateTopologicalEdge(const NCollection_DynamicArray& theVertexVec, + const NCollection_DynamicArray& theFaceVec, + const double theTol); //! Sets vertex void SetVertex(const int thePlaceID, const int theVertID) @@ -264,20 +264,20 @@ protected: return Point(thePnt.X() + theTol, thePnt.Y() + theTol, thePnt.Z() + theTol); } - NodeInspector(const NCollection_Vector& theVec, - const gp_Pnt& thePnt, - const double theTol); + NodeInspector(const NCollection_DynamicArray& theVec, + const gp_Pnt& thePnt, + const double theTol); Standard_EXPORT NCollection_CellFilter_Action Inspect(const Target theId); Target GetResult() { return myResID; } private: - NodeInspector& operator=(const NodeInspector&) = delete; - const NCollection_Vector& myVecOfVertexes; - gp_Pnt myPoint; - double mySQToler; - Target myResID; + NodeInspector& operator=(const NodeInspector&) = delete; + const NCollection_DynamicArray& myVecOfVertexes; + gp_Pnt myPoint; + double mySQToler; + Target myResID; }; private: @@ -286,11 +286,11 @@ private: // myFaceVec, myVertexVec and myEdgeVec lists are filled only once!!!!! //! Vector of faces - NCollection_Vector myFaceVec; + NCollection_DynamicArray myFaceVec; //! Vector of Vertices - NCollection_Vector myVertexVec; + NCollection_DynamicArray myVertexVec; //! Vector of edges - NCollection_Vector myEdgeVec; + NCollection_DynamicArray myEdgeVec; //! Tolerance double myTolerance; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_VertexInspector.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_VertexInspector.hxx index 9db761e36b..bd0f4bc72a 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_VertexInspector.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_VertexInspector.hxx @@ -18,11 +18,11 @@ #include #include -#include +#include #include #include -typedef NCollection_Vector VectorOfPoint; +typedef NCollection_DynamicArray VectorOfPoint; //! Inspector for CellFilter algorithm working with gp_XYZ points in 3d space. //! Used in search of coincidence points with a certain tolerance. diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Solid.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Solid.cxx index 641267f590..851485df9c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Solid.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Solid.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -152,7 +152,7 @@ protected: }; // -typedef NCollection_Vector BRepCheck_VectorOfToolSolid; +typedef NCollection_DynamicArray BRepCheck_VectorOfToolSolid; // diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx index 498d075728..2720e7fe73 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -452,14 +452,14 @@ struct DistancePairFunctor return aSize; } - NCollection_Array1* BandArray; - mutable NCollection_Array1> PairList; - const NCollection_Array1* LBox1; - const NCollection_Array1* LBox2; - Message_ProgressScope Scope; - NCollection_Array1 Ranges; - double DistRef; - double Eps; + NCollection_Array1* BandArray; + mutable NCollection_Array1> PairList; + const NCollection_Array1* LBox1; + const NCollection_Array1* LBox2; + Message_ProgressScope Scope; + NCollection_Array1 Ranges; + double DistRef; + double Eps; }; //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx index a1ed0fd7c8..eacaaadaba 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx @@ -42,13 +42,13 @@ BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool() // purpose : Creates new tool for the given element sets //======================================================================= BRepExtrema_ProximityDistTool::BRepExtrema_ProximityDistTool( - const occ::handle& theSet1, - const int theNbSamples1, - const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2) + const occ::handle& theSet1, + const int theNbSamples1, + const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2) : myMinDistance(std::numeric_limits::max()), myProxDist(-1.), myPntStatus1(ProxPnt_Status_UNKNOWN), @@ -78,8 +78,8 @@ void BRepExtrema_ProximityDistTool::LoadTriangleSets( // purpose : Loads the given list of subshapes into the proximity tool //======================================================================= void BRepExtrema_ProximityDistTool::LoadShapeLists( - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2) + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2) { myShapeList1 = theShapeList1; myShapeList2 = theShapeList2; @@ -90,8 +90,8 @@ void BRepExtrema_ProximityDistTool::LoadShapeLists( // purpose : Loads given additional vertices and their statuses //======================================================================= void BRepExtrema_ProximityDistTool::LoadAdditionalPointsFirstSet( - const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1) + const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1) { myAddVertices1 = theAddVertices1; myAddStatus1 = theAddStatus1; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.hxx index c9615e754c..bb9aff3406 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.hxx @@ -94,13 +94,13 @@ public: //! Creates new tool for the given element sets. Standard_EXPORT BRepExtrema_ProximityDistTool( - const occ::handle& theSet1, - const int theNbSamples1, - const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2); + const occ::handle& theSet1, + const int theNbSamples1, + const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2); public: //! Loads the given element sets into the tool. @@ -108,12 +108,12 @@ public: const occ::handle& theSet2); //! Loads the given list of subshapes into the tool. - Standard_EXPORT void LoadShapeLists(const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2); + Standard_EXPORT void LoadShapeLists(const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2); //! Loads given additional vertices and their statuses. - void LoadAdditionalPointsFirstSet(const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1); + void LoadAdditionalPointsFirstSet(const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1); //! Performs searching of the proximity distance. Standard_EXPORT void Perform(); @@ -196,9 +196,9 @@ private: occ::handle mySet2; //! List of subshapes of the 1st shape. - NCollection_Vector myShapeList1; + NCollection_DynamicArray myShapeList1; //! List of subshapes of the 2nd shape. - NCollection_Vector myShapeList2; + NCollection_DynamicArray myShapeList2; int myNbSamples1; //!< Number of samples points on the first shape @@ -206,7 +206,7 @@ private: int myIsProxVtx1FromAddSet; BVH_Array3d myAddVertices1; //!< Additional vertices on the 1st shape // clang-format off - NCollection_Vector myAddStatus1; //!< Status of additional vertices on the 1st shape + NCollection_DynamicArray myAddStatus1; //!< Status of additional vertices on the 1st shape // clang-format on //! Vertex index from 1st BVH corresponding to proximity point of 1st shape diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx index 1a4c1ea68a..99735f25b3 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx @@ -46,10 +46,10 @@ BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool() // purpose : Creates new proximity tool for the given element sets //======================================================================= BRepExtrema_ProximityValueTool::BRepExtrema_ProximityValueTool( - const occ::handle& theSet1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2) + const occ::handle& theSet1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2) : myIsRefinementRequired1(false), myIsRefinementRequired2(false), myDistance(std::numeric_limits::max()), @@ -165,8 +165,8 @@ bool BRepExtrema_ProximityValueTool::getInfoForRefinement(const TopoDS_Shape& th // purpose : Loads the given list of subshapes into the proximity tool //======================================================================= void BRepExtrema_ProximityValueTool::LoadShapeLists( - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2) + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2) { myShapeList1 = theShapeList1; myShapeList2 = theShapeList2; @@ -197,17 +197,17 @@ void BRepExtrema_ProximityValueTool::SetNbSamplePoints(const int theSamples1, co // purpose : Returns the computed proximity value from first BVH to another one //======================================================================= double BRepExtrema_ProximityValueTool::computeProximityDist( - const occ::handle& theSet1, - const int theNbSamples1, - const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2, - BVH_Vec3d& thePoint1, - BVH_Vec3d& thePoint2, - ProxPnt_Status& thePointStatus1, - ProxPnt_Status& thePointStatus2) const + const occ::handle& theSet1, + const int theNbSamples1, + const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2, + BVH_Vec3d& thePoint1, + BVH_Vec3d& thePoint2, + ProxPnt_Status& thePointStatus1, + ProxPnt_Status& thePointStatus2) const { BRepExtrema_ProximityDistTool aProxDistTool(theSet1, theNbSamples1, @@ -232,10 +232,10 @@ double BRepExtrema_ProximityValueTool::computeProximityDist( // purpose : Gets additional vertices and their statuses on the edge with the input step //======================================================================= bool BRepExtrema_ProximityValueTool::getEdgeAdditionalVertices( - const TopoDS_Edge& theEdge, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses) + const TopoDS_Edge& theEdge, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses) { BRepAdaptor_Curve aBAC(theEdge); @@ -280,10 +280,10 @@ bool BRepExtrema_ProximityValueTool::getEdgeAdditionalVertices( void BRepExtrema_ProximityValueTool::doRecurTrgSplit( const gp_Pnt (&theTrg)[3], const ProxPnt_Status (&theEdgesStatus)[3], - const double theTol, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses) + const double theTol, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses) { gp_XYZ aTrgSide1 = theTrg[1].Coord() - theTrg[0].Coord(); gp_XYZ aTrgSide2 = theTrg[2].Coord() - theTrg[0].Coord(); @@ -404,10 +404,10 @@ static void getEdgesStatus(const int theTriIdx, // square) //======================================================================= bool BRepExtrema_ProximityValueTool::getFaceAdditionalVertices( - const TopoDS_Face& theFace, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses) + const TopoDS_Face& theFace, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses) { constexpr double aTol = Precision::Confusion(); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.hxx index 629bafe550..ea7016e977 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.hxx @@ -21,7 +21,7 @@ #include #include -typedef NCollection_Vector VectorOfPoint; +typedef NCollection_DynamicArray VectorOfPoint; //! Inspector for CellFilter algorithm working with gp_XYZ points in 3d space. //! Used in search of coincidence points with a certain tolerance. @@ -92,10 +92,10 @@ public: //! Creates new proximity tool for the given element sets. Standard_EXPORT BRepExtrema_ProximityValueTool( - const occ::handle& theSet1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2); + const occ::handle& theSet1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2); public: //! Loads the given element sets into the proximity tool. @@ -103,8 +103,8 @@ public: const occ::handle& theSet2); //! Loads the given list of subshapes into the proximity tool. - Standard_EXPORT void LoadShapeLists(const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2); + Standard_EXPORT void LoadShapeLists(const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2); //! Sets number of sample points used for proximity calculation for each shape. //! If number is less or equal zero, all triangulation nodes are used. @@ -144,41 +144,41 @@ private: double& theStep); //! Returns the computed proximity value from first BVH to another one. - double computeProximityDist(const occ::handle& theSet1, - const int theNbSamples1, - const BVH_Array3d& theAddVertices1, - const NCollection_Vector& theAddStatus1, - const occ::handle& theSet2, - const NCollection_Vector& theShapeList1, - const NCollection_Vector& theShapeList2, - BVH_Vec3d& thePoint1, - BVH_Vec3d& thePoint2, - ProxPnt_Status& thePointStatus1, - ProxPnt_Status& thePointStatus2) const; + double computeProximityDist(const occ::handle& theSet1, + const int theNbSamples1, + const BVH_Array3d& theAddVertices1, + const NCollection_DynamicArray& theAddStatus1, + const occ::handle& theSet2, + const NCollection_DynamicArray& theShapeList1, + const NCollection_DynamicArray& theShapeList2, + BVH_Vec3d& thePoint1, + BVH_Vec3d& thePoint2, + ProxPnt_Status& thePointStatus1, + ProxPnt_Status& thePointStatus2) const; //! Gets additional vertices on shapes with refining a coarser one if it's needed. bool getShapesAdditionalVertices(); //! Gets additional vertices and their statuses on the edge with the input step. - bool getEdgeAdditionalVertices(const TopoDS_Edge& theEdge, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses); + bool getEdgeAdditionalVertices(const TopoDS_Edge& theEdge, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses); //! Gets additional vertices and their statuses on the face with the input step (triangle square). - bool getFaceAdditionalVertices(const TopoDS_Face& theFace, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses); + bool getFaceAdditionalVertices(const TopoDS_Face& theFace, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses); //! Splits the triangle recursively, halving the longest side //! to the area of the current triangle > input step void doRecurTrgSplit(const gp_Pnt (&theTrg)[3], const ProxPnt_Status (&theEdgesStatus)[3], - const double theTol, - const double theStep, - BVH_Array3d& theAddVertices, - NCollection_Vector& theAddStatuses); + const double theTol, + const double theStep, + BVH_Array3d& theAddVertices, + NCollection_DynamicArray& theAddStatuses); private: //! Set of all mesh primitives of the 1st shape. @@ -187,9 +187,9 @@ private: occ::handle mySet2; //! List of subshapes of the 1st shape. - NCollection_Vector myShapeList1; + NCollection_DynamicArray myShapeList1; //! List of subshapes of the 2nd shape. - NCollection_Vector myShapeList2; + NCollection_DynamicArray myShapeList2; //! The 1st shape. TopoDS_Shape myShape1; @@ -200,8 +200,8 @@ private: BVH_Array3d myAddVertices2; //!< Additional vertices on the 2nd shape if its mesh is coarser. // clang-format off - NCollection_Vector myAddStatus1; //!< Status of additional vertices on the 1st shape. - NCollection_Vector myAddStatus2; //!< Status of additional vertices on the 2nd shape. + NCollection_DynamicArray myAddStatus1; //!< Status of additional vertices on the 1st shape. + NCollection_DynamicArray myAddStatus2; //!< Status of additional vertices on the 2nd shape. // clang-format on bool myIsInitS1; //!< Is the 1st shape initialized? diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.hxx index 095ab8fd0b..aee5e57e8d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_SelfIntersection.hxx @@ -111,7 +111,7 @@ private: bool myIsInit; //! List of triangulated faces of the shape. - NCollection_Vector myFaceList; + NCollection_DynamicArray myFaceList; //! Set of all the face triangles of the shape. occ::handle myElementSet; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.cxx index 5312cb4bb6..df9e48dfbf 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.cxx @@ -19,9 +19,9 @@ #include // Assign a map of sub-shapes (edges/faces) of a given shape -static bool initSubShapes(const TopoDS_Shape& theShape, - NCollection_Vector& theSubshapesList, - occ::handle& theTriangleSet) +static bool initSubShapes(const TopoDS_Shape& theShape, + NCollection_DynamicArray& theSubshapesList, + occ::handle& theTriangleSet) { theSubshapesList.Clear(); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.hxx index 9d44e92c8b..e006ef8e16 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ShapeProximity.hxx @@ -137,9 +137,9 @@ private: bool myIsInitS2; //! List of subshapes of the 1st shape. - NCollection_Vector myShapeList1; + NCollection_DynamicArray myShapeList1; //! List of subshapes of the 2nd shape. - NCollection_Vector myShapeList2; + NCollection_DynamicArray myShapeList2; //! Set of all the face triangles of the 1st shape. occ::handle myElementSet1; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx index 59b06f413c..e33bd31ecb 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.cxx @@ -35,7 +35,8 @@ BRepExtrema_TriangleSet::BRepExtrema_TriangleSet() // function : BRepExtrema_TriangleSet // purpose : Creates triangle set from the given face //======================================================================= -BRepExtrema_TriangleSet::BRepExtrema_TriangleSet(const NCollection_Vector& theFaces) +BRepExtrema_TriangleSet::BRepExtrema_TriangleSet( + const NCollection_DynamicArray& theFaces) { // Set default builder - linear BVH (LBVH) myBuilder = @@ -214,7 +215,7 @@ void BRepExtrema_TriangleSet::Clear() //================================================================================================= -bool BRepExtrema_TriangleSet::Init(const NCollection_Vector& theShapes) +bool BRepExtrema_TriangleSet::Init(const NCollection_DynamicArray& theShapes) { Clear(); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.hxx index 8072179bfd..09021ae032 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_TriangleSet.hxx @@ -34,7 +34,7 @@ public: Standard_EXPORT BRepExtrema_TriangleSet(); //! Creates triangle set from the given face. - Standard_EXPORT BRepExtrema_TriangleSet(const NCollection_Vector& theFaces); + Standard_EXPORT BRepExtrema_TriangleSet(const NCollection_DynamicArray& theFaces); //! Releases resources of triangle set. Standard_EXPORT ~BRepExtrema_TriangleSet() override; @@ -60,7 +60,7 @@ public: Standard_EXPORT void Clear(); //! Initializes triangle set. - Standard_EXPORT bool Init(const NCollection_Vector& theShapes); + Standard_EXPORT bool Init(const NCollection_DynamicArray& theShapes); //! Returns all vertices. Standard_EXPORT const BVH_Array3d& GetVertices() const { return myVertexArray; } @@ -110,13 +110,13 @@ protected: //! Vector of shapes' indices where index of item corresponds to index of vertex, //! belonging to this shape. - NCollection_Vector myShapeIdxOfVtxVec; + NCollection_DynamicArray myShapeIdxOfVtxVec; //! Vector of vertexes' number belonging to shape which index corresponds item's index. - NCollection_Vector myNumVtxInShapeVec; + NCollection_DynamicArray myNumVtxInShapeVec; //! Vector of triangles' number belonging to shape which index corresponds item's index. - NCollection_Vector myNumTrgInShapeVec; + NCollection_DynamicArray myNumTrgInShapeVec; //! Map of triangles' indices after (key) and before (value) swapping. NCollection_DataMap myTrgIdxMap; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx index 95d8f4ece7..3fed5077d9 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx @@ -44,7 +44,7 @@ #include #include #include -#include +#include //================================================================================================= @@ -177,7 +177,7 @@ static void fillParams(const NCollection_Array1& theKnots, int theDegree, double theParMin, double theParMax, - NCollection_Vector& theParams) + NCollection_DynamicArray& theParams) { double aPrevPar = theParMin; theParams.Append(aPrevPar); @@ -207,10 +207,10 @@ static void fillParams(const NCollection_Array1& theKnots, theParams.Append(theParMax); } -static void fillPoints(const BRepAdaptor_Curve& theCurve, - const NCollection_Vector& theParams, - NCollection_Sequence& thePoints, - NCollection_Sequence& theWeights) +static void fillPoints(const BRepAdaptor_Curve& theCurve, + const NCollection_DynamicArray& theParams, + NCollection_Sequence& thePoints, + NCollection_Sequence& theWeights) { double aDistPrev = 0., aDistNext; gp_Pnt aPPrev(theCurve.Value(theParams(0))), aPNext; @@ -355,7 +355,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, int iNbPoints = 0; // Fill the parameters of the sampling points - NCollection_Vector aParams; + NCollection_DynamicArray aParams; switch (c.GetType()) { case GeomAbs_BezierCurve: { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph.cxx index be4d2158d5..4fc1a00fa6 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph.cxx @@ -217,7 +217,7 @@ bool BRepGraph::IsDone() const //================================================================================================= -const NCollection_Vector& BRepGraph::RootProductIds() const +const NCollection_DynamicArray& BRepGraph::RootProductIds() const { return myData->myRootProductIds; } @@ -364,7 +364,7 @@ void BRepGraph::invalidateSubgraphImpl(const BRepGraph_NodeId theNode) + aStorage.NbProducts() + aStorage.NbOccurrences(); const uint32_t aMaxDepth = aNbNodes > 0 ? aNbNodes : 1; occ::handle anAlloc = new NCollection_IncAllocator(); - NCollection_Vector aStack(64, anAlloc); + NCollection_DynamicArray aStack(64, anAlloc); NCollection_Map aVisited(static_cast(aNbNodes), anAlloc); aStack.Append({theNode, 0}); @@ -598,7 +598,7 @@ void BRepGraph::propagateSubtreeGen(const BRepGraph_NodeId theNodeId) noexcept // Vertex modifications don't propagate. break; case BRepGraph_NodeId::Kind::Edge: { - const NCollection_Vector* aWires = + const NCollection_DynamicArray* aWires = aRevIdx.WiresOfEdge(BRepGraph_EdgeId(theNodeId)); if (aWires != nullptr) for (const BRepGraph_WireId& aWireId : *aWires) @@ -606,7 +606,7 @@ void BRepGraph::propagateSubtreeGen(const BRepGraph_NodeId theNodeId) noexcept break; } case BRepGraph_NodeId::Kind::Wire: { - const NCollection_Vector* aFaces = + const NCollection_DynamicArray* aFaces = aRevIdx.FacesOfWire(BRepGraph_WireId(theNodeId)); if (aFaces != nullptr) for (const BRepGraph_FaceId& aFaceId : *aFaces) @@ -614,7 +614,7 @@ void BRepGraph::propagateSubtreeGen(const BRepGraph_NodeId theNodeId) noexcept break; } case BRepGraph_NodeId::Kind::Face: { - const NCollection_Vector* aShells = + const NCollection_DynamicArray* aShells = aRevIdx.ShellsOfFace(BRepGraph_FaceId(theNodeId)); if (aShells != nullptr) for (const BRepGraph_ShellId& aShellId : *aShells) @@ -622,7 +622,7 @@ void BRepGraph::propagateSubtreeGen(const BRepGraph_NodeId theNodeId) noexcept break; } case BRepGraph_NodeId::Kind::Shell: { - const NCollection_Vector* aSolids = + const NCollection_DynamicArray* aSolids = aRevIdx.SolidsOfShell(BRepGraph_ShellId(theNodeId)); if (aSolids != nullptr) for (const BRepGraph_SolidId& aSolidId : *aSolids) @@ -758,7 +758,7 @@ void BRepGraph::markRepModified(const BRepGraph_RepId theRepId) noexcept myData->myMeshCache.FindFaceMesh(aFaceId); if (aCached != nullptr) { - for (NCollection_Vector::Iterator aTriIt( + for (NCollection_DynamicArray::Iterator aTriIt( aCached->TriangulationRepIds); aTriIt.More(); aTriIt.Next()) @@ -823,7 +823,7 @@ void BRepGraph::markRepModified(const BRepGraph_RepId theRepId) noexcept myData->myMeshCache.FindCoEdgeMesh(aCoEdgeId); if (aCached != nullptr) { - for (NCollection_Vector::Iterator aPolyIt( + for (NCollection_DynamicArray::Iterator aPolyIt( aCached->PolygonOnTriRepIds); aPolyIt.More(); aPolyIt.Next()) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph.hxx index ca92562c36..5c07a36128 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph.hxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include @@ -146,8 +146,8 @@ public: //! Return root product identifiers (products not referenced by any active occurrence). //! Maintained incrementally by Editor/EditorView mutations. //! Returns empty vector if the graph has not been built. - [[nodiscard]] Standard_EXPORT const NCollection_Vector& RootProductIds() - const; + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& + RootProductIds() const; //! Replace the internal allocator and re-create all storage. Standard_EXPORT void SetAllocator(const occ::handle& theAlloc); diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Builder.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Builder.cxx index 404f8641d4..fe4981067f 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Builder.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Builder.cxx @@ -321,7 +321,7 @@ void BRepGraph_Builder::AppendFlattened(BRepGraph& th theGraph.LayerRegistry().FindLayer(); const occ::handle aRegularityLayer = theGraph.LayerRegistry().FindLayer(); - NCollection_Vector aAppendedRoots(8, theGraph.Allocator()); + NCollection_DynamicArray aAppendedRoots(8, theGraph.Allocator()); BRepGraphInc_Populate::AppendFlattened(aStorage, theShape, theParallel, diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Compact.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Compact.cxx index 3d895900e1..9ab6d46aeb 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Compact.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Compact.cxx @@ -178,10 +178,10 @@ bool isShellClosedByIncidence(const BRepGraph& theGraph, const BRepGraph_ShellId continue; } - int aFaceCountInShell = 0; - const NCollection_Vector& aEdgeFaces = + int aFaceCountInShell = 0; + const NCollection_DynamicArray& aEdgeFaces = theGraph.Topo().Edges().Faces(anEdgeId); - for (NCollection_Vector::Iterator aFaceIt(aEdgeFaces); aFaceIt.More(); + for (NCollection_DynamicArray::Iterator aFaceIt(aEdgeFaces); aFaceIt.More(); aFaceIt.Next()) { if (aShellFaces.Contains(aFaceIt.Value())) @@ -488,9 +488,9 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const continue; } - NCollection_Vector> aNewEntries; - NCollection_Vector anOldCoEdges; - NCollection_Vector anOldCoEdgeRefs; + NCollection_DynamicArray> aNewEntries; + NCollection_DynamicArray anOldCoEdges; + NCollection_DynamicArray anOldCoEdgeRefs; for (BRepGraph_RefsCoEdgeOfWire aRefIt(theGraph, anOldWireId); aRefIt.More(); aRefIt.Next()) { const BRepGraphInc::CoEdgeRef& aCR = theGraph.Refs().CoEdges().Entry(aRefIt.CurrentId()); @@ -507,7 +507,7 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const } const BRepGraph_WireId aNewWireId = aNewGraph.Editor().Wires().Add(aNewEntries); - const NCollection_Vector& aNewCoEdgeRefs = + const NCollection_DynamicArray& aNewCoEdgeRefs = aNewGraph.Topo().Wires().Definition(aNewWireId).CoEdgeRefIds; for (size_t aRefIdx = 0; aRefIdx < anOldCoEdgeRefs.Size() && aRefIdx < aNewCoEdgeRefs.Size(); ++aRefIdx) @@ -544,10 +544,10 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const const occ::handle& aSurf = BRepGraph_Tool::Face::Surface(theGraph, anOldFaceId); // Find outer wire from incidence ref entries. - BRepGraph_WireId aNewOuterWire; - NCollection_Vector aNewInnerWires; - BRepGraph_WireRefId anOldOuterWireRef; - NCollection_Vector anOldInnerWireRefs; + BRepGraph_WireId aNewOuterWire; + NCollection_DynamicArray aNewInnerWires; + BRepGraph_WireRefId anOldOuterWireRef; + NCollection_DynamicArray anOldInnerWireRefs; for (BRepGraph_RefsWireOfFace aRefIt(theGraph, anOldFaceId); aRefIt.More(); aRefIt.Next()) { @@ -573,7 +573,7 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const BRepGraph_MutGuard aNewFace = aNewGraph.Editor().Faces().Mut(aNewFaceId); aNewFace->NaturalRestriction = anOldFace.NaturalRestriction; - const NCollection_Vector& aNewWireRefs = aNewFace->WireRefIds; + const NCollection_DynamicArray& aNewWireRefs = aNewFace->WireRefIds; if (anOldOuterWireRef.IsValid() && !aNewWireRefs.IsEmpty()) { const BRepGraphInc::WireRef& anOldOuterRef = theGraph.Refs().Wires().Entry(anOldOuterWireRef); @@ -820,8 +820,8 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const continue; } - NCollection_Vector aNewChildren; - NCollection_Vector anOldChildRefs; + NCollection_DynamicArray aNewChildren; + NCollection_DynamicArray anOldChildRefs; for (BRepGraph_RefsChildOfCompound aRefIt(theGraph, anOldCompoundId); aRefIt.More(); aRefIt.Next()) { @@ -836,7 +836,7 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const const BRepGraph_CompoundId aNewCompoundId = aNewGraph.Editor().Compounds().Add(aNewChildren); if (aNewCompoundId.IsValid()) { - const NCollection_Vector& aNewChildRefs = + const NCollection_DynamicArray& aNewChildRefs = aNewGraph.Topo().Compounds().Definition(aNewCompoundId).ChildRefIds; for (size_t aRefIdx = 0; aRefIdx < anOldChildRefs.Size() && aRefIdx < aNewChildRefs.Size(); ++aRefIdx) @@ -861,8 +861,8 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const continue; } - NCollection_Vector aNewSolids; - NCollection_Vector anOldSolidRefs; + NCollection_DynamicArray aNewSolids; + NCollection_DynamicArray anOldSolidRefs; for (BRepGraph_RefsSolidOfCompSolid aRefIt(theGraph, anOldCompSolidId); aRefIt.More(); aRefIt.Next()) { @@ -877,7 +877,7 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const const BRepGraph_CompSolidId aNewCompSolidId = aNewGraph.Editor().CompSolids().Add(aNewSolids); if (aNewCompSolidId.IsValid()) { - const NCollection_Vector& aNewSolidRefs = + const NCollection_DynamicArray& aNewSolidRefs = aNewGraph.Topo().CompSolids().Definition(aNewCompSolidId).SolidRefIds; for (size_t aRefIdx = 0; aRefIdx < anOldSolidRefs.Size() && aRefIdx < aNewSolidRefs.Size(); ++aRefIdx) @@ -1113,9 +1113,9 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const // Transfer per-kind UID vectors from old graph to new graph using index remap maps. // Each new graph's UID vector[newIdx] = old graph's UID vector[oldIdx]. - auto transferUIDs = [&](const auto& theMap, - const NCollection_Vector& theOldVec, - NCollection_Vector& theNewVec) { + auto transferUIDs = [&](const auto& theMap, + const NCollection_DynamicArray& theOldVec, + NCollection_DynamicArray& theNewVec) { // New vector was already populated by EditorView during reconstruction. // Overwrite entries that have a mapping from the old graph. for (const auto& [anOldId, aNewId] : theMap.Items()) @@ -1130,9 +1130,9 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const }; // Same logic for per-kind RefUID vectors. - auto transferRefUIDs = [&](const auto& theMap, - const NCollection_Vector& theOldVec, - NCollection_Vector& theNewVec) { + auto transferRefUIDs = [&](const auto& theMap, + const NCollection_DynamicArray& theOldVec, + NCollection_DynamicArray& theNewVec) { for (const auto& [anOldId, aNewId] : theMap.Items()) { if (anOldId.IsValidIn(theOldVec) @@ -1236,8 +1236,8 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const // TopoDS_Shape data. The rebuilt aNewGraph has no TopoDS_Shape bindings, so they must be // transferred here. We capture into local vectors using the ForEach API, then remap keys/values // after the swap. - NCollection_Vector> aTShapeBindings; - NCollection_Vector> aOriginalBindings; + NCollection_DynamicArray> aTShapeBindings; + NCollection_DynamicArray> aOriginalBindings; aGraphData->myIncStorage.ForEachTShapeBinding( [&](const TopoDS_TShape* theTShape, const BRepGraph_NodeId& theNodeId) { aTShapeBindings.Append({theTShape, theNodeId}); @@ -1329,7 +1329,7 @@ BRepGraph_Compact::Result BRepGraph_Compact::Perform(BRepGraph& theGraph, const anIt.More(); anIt.Next()) { - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(anIt.Value()); theGraph.History().Record(TCollection_AsciiString("Compact:Remap"), anIt.Key(), aRepl); } diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Copy.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Copy.cxx index 64cafc473d..b3e54273e4 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Copy.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Copy.cxx @@ -160,7 +160,7 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG for (BRepGraph_FullWireIterator aWireIt(theGraph); aWireIt.More(); aWireIt.Next()) { const BRepGraph_WireId aWireId = aWireIt.CurrentId(); - NCollection_Vector> aWireEdges; + NCollection_DynamicArray> aWireEdges; for (BRepGraph_RefsCoEdgeOfWire aCEIt(theGraph, aWireId); aCEIt.More(); aCEIt.Next()) { const BRepGraphInc::CoEdgeDef& aCoEdge = @@ -182,8 +182,8 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG occ::handle aSurf = copySurface(aFaceSrcSurf, theCopyGeom); // Get outer/inner wire def NodeIds via typed iterator. - BRepGraph_WireId anOuterWire; - NCollection_Vector anInnerWires; + BRepGraph_WireId anOuterWire; + NCollection_DynamicArray anInnerWires; for (BRepGraph_RefsWireOfFace aWRIt(theGraph, aFaceId); aWRIt.More(); aWRIt.Next()) { @@ -219,8 +219,8 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG // PCurves via CoEdge data (after edges and faces are created). for (BRepGraph_FullEdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIds = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIds = theGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIds) { @@ -275,8 +275,8 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG // Compounds. for (BRepGraph_FullCompoundIterator aCompoundIt(theGraph); aCompoundIt.More(); aCompoundIt.Next()) { - const BRepGraph_CompoundId aCompoundId = aCompoundIt.CurrentId(); - NCollection_Vector aChildNodeIds; + const BRepGraph_CompoundId aCompoundId = aCompoundIt.CurrentId(); + NCollection_DynamicArray aChildNodeIds; for (BRepGraph_RefsChildOfCompound aCRIt(theGraph, aCompoundId); aCRIt.More(); aCRIt.Next()) { aChildNodeIds.Append(aRefs.Children().Entry(aCRIt.CurrentId()).ChildDefId); @@ -289,8 +289,8 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG for (BRepGraph_FullCompSolidIterator aCompSolidIt(theGraph); aCompSolidIt.More(); aCompSolidIt.Next()) { - const BRepGraph_CompSolidId aCompSolidId = aCompSolidIt.CurrentId(); - NCollection_Vector aSolidNodeIds; + const BRepGraph_CompSolidId aCompSolidId = aCompSolidIt.CurrentId(); + NCollection_DynamicArray aSolidNodeIds; for (BRepGraph_RefsSolidOfCompSolid aSRIt(theGraph, aCompSolidId); aSRIt.More(); aSRIt.Next()) { aSolidNodeIds.Append(aRefs.Solids().Entry(aSRIt.CurrentId()).SolidDefId); @@ -332,10 +332,10 @@ BRepGraph BRepGraph_Copy::Perform(const BRepGraph& theGraph, const bool theCopyG } // Phase 3: Transfer UIDs (identity mapping - direct vector copy). - auto copyUIDs = [](const NCollection_Vector& theSrc, - NCollection_Vector& theDst) { - NCollection_Vector::Iterator aDstIt(theDst); - NCollection_Vector::Iterator anSrcIt(theSrc); + auto copyUIDs = [](const NCollection_DynamicArray& theSrc, + NCollection_DynamicArray& theDst) { + NCollection_DynamicArray::Iterator aDstIt(theDst); + NCollection_DynamicArray::Iterator anSrcIt(theSrc); for (; anSrcIt.More() && aDstIt.More(); anSrcIt.Next(), aDstIt.Next()) { if (anSrcIt.Value().IsValid()) @@ -521,7 +521,7 @@ BRepGraph BRepGraph_Copy::CopyFace(const BRepGraph& theGraph, for (int anIdx = 1; anIdx <= aWireSet.Extent(); ++anIdx) { const BRepGraph_WireId anOldWireId = aWireSet.FindKey(anIdx); - NCollection_Vector> aNewEntries; + NCollection_DynamicArray> aNewEntries; for (BRepGraph_RefsCoEdgeOfWire aCEIt(theGraph, anOldWireId); aCEIt.More(); aCEIt.Next()) { const BRepGraphInc::CoEdgeDef& aCoEdge = @@ -539,8 +539,8 @@ BRepGraph BRepGraph_Copy::CopyFace(const BRepGraph& theGraph, const occ::handle& aFaceSrcSurf = BRepGraph_Tool::Face::Surface(theGraph, theFace); occ::handle aSurf = copySurface(aFaceSrcSurf, theCopyGeom); - BRepGraph_WireId anOuterWire; - NCollection_Vector anInnerWires; + BRepGraph_WireId anOuterWire; + NCollection_DynamicArray anInnerWires; for (BRepGraph_RefsWireOfFace aWRIt(theGraph, theFace); aWRIt.More(); aWRIt.Next()) { @@ -579,9 +579,9 @@ BRepGraph BRepGraph_Copy::CopyFace(const BRepGraph& theGraph, // PCurves for edges in this face via CoEdge data. for (int anIdx = 1; anIdx <= anEdgeSet.Extent(); ++anIdx) { - const BRepGraph_EdgeId anOldEdgeId = anEdgeSet.FindKey(anIdx); - const BRepGraph_EdgeId aNewEdgeId(anIdx - 1); - const NCollection_Vector& aCoEdgeIds = + const BRepGraph_EdgeId anOldEdgeId = anEdgeSet.FindKey(anIdx); + const BRepGraph_EdgeId aNewEdgeId(anIdx - 1); + const NCollection_DynamicArray& aCoEdgeIds = theGraph.Topo().Edges().CoEdges(anOldEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIds) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Data.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Data.hxx index 93777e60bd..cfef3442f5 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Data.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Data.hxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ struct BRepGraph_Data //! Root product identifiers: products not referenced by any active occurrence. //! Maintained incrementally by Editor/EditorView mutations. - NCollection_Vector myRootProductIds; + NCollection_DynamicArray myRootProductIds; //! When true, markModified() only increments OwnGen + SubtreeGen and appends to //! myDeferredModified - no mutex acquisition and no upward propagation. @@ -83,10 +83,10 @@ struct BRepGraph_Data std::atomic myPropagationWave{0}; //! NodeIds accumulated during deferred mode. Processed by EndDeferredInvalidation(). - NCollection_Vector myDeferredModified; + NCollection_DynamicArray myDeferredModified; //! RefIds accumulated during deferred mode. Processed by EndDeferredInvalidation(). - NCollection_Vector myDeferredRefModified; + NCollection_DynamicArray myDeferredRefModified; //! Gen-validated shape cache entry. struct CachedShape diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.cxx index f23a7e0924..56e31672ff 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.cxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -161,7 +161,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG ++aResult.NbSurfaceRewrites; aResult.AffectedFaces.Append(aFaceId); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(aCanonFaceId); theGraph.History().Record(TCollection_AsciiString("Dedup:CanonicalizeSurface"), aFaceId, @@ -190,7 +190,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG ++aResult.NbCurveRewrites; aResult.AffectedEdges.Append(anEdgeId); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(aCanonEdgeId); theGraph.History().Record(TCollection_AsciiString("Dedup:CanonicalizeCurve"), anEdgeId, @@ -214,7 +214,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG // Collect active vertices: (point, graph id) pairs. const uint32_t aNbVertices = theGraph.Topo().Vertices().Nb(); - NCollection_Vector> aActiveVertices(256, aTmpAlloc); + NCollection_DynamicArray> aActiveVertices(256, aTmpAlloc); for (BRepGraph_FullVertexIterator aVertexIt(theGraph); aVertexIt.More(); aVertexIt.Next()) { const BRepGraph_VertexId aVertexId = aVertexIt.CurrentId(); @@ -332,7 +332,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG // Mark non-canonical as removed. theGraph.Editor().Gen().RemoveNode(anOldId, aCanonId); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(aCanonId); theGraph.History().Record(TCollection_AsciiString("Dedup:MergeVertex"), anOldId, aRepl); ++aResult.NbHistoryRecords; @@ -375,9 +375,8 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG bool operator()(const EdgeKey& theA, const EdgeKey& theB) const { return theA == theB; } }; - NCollection_DataMap, EdgeKeyHasher> anEdgeGroups( - std::max(1, theGraph.Topo().Edges().Nb()), - aTmpAlloc); + NCollection_DataMap, EdgeKeyHasher> + anEdgeGroups(std::max(1, theGraph.Topo().Edges().Nb()), aTmpAlloc); for (BRepGraph_FullEdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { @@ -399,7 +398,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG if (aKey.StartVtx > aKey.EndVtx) std::swap(aKey.StartVtx, aKey.EndVtx); - anEdgeGroups.TryBind(aKey, NCollection_Vector()); + anEdgeGroups.TryBind(aKey, NCollection_DynamicArray()); anEdgeGroups.ChangeFind(aKey).Append(anEdgeId); } @@ -407,12 +406,12 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG std::max(1, theGraph.Topo().Edges().Nb()), aTmpAlloc); - for (NCollection_DataMap, EdgeKeyHasher>::Iterator - aGroupIter(anEdgeGroups); + for (NCollection_DataMap, EdgeKeyHasher>:: + Iterator aGroupIter(anEdgeGroups); aGroupIter.More(); aGroupIter.Next()) { - const NCollection_Vector& aGroup = aGroupIter.Value(); + const NCollection_DynamicArray& aGroup = aGroupIter.Value(); if (aGroup.Size() < 2) continue; @@ -461,7 +460,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG const bool isReversed = (aCanonStart == anOldEnd && aCanonEnd == anOldStart); // Replace in wires. - const NCollection_Vector& aWires = + const NCollection_DynamicArray& aWires = theGraph.Topo().Edges().Wires(anOldEdgeId); for (const BRepGraph_WireId& aWireId : aWires) { @@ -475,7 +474,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG theGraph.Editor().Gen().RemoveNode(anOldId, aCanonId); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(aCanonId); theGraph.History().Record(TCollection_AsciiString("Dedup:MergeEdge"), anOldId, aRepl); ++aResult.NbHistoryRecords; @@ -511,8 +510,8 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG }; auto wiresEqual = [&](const BRepGraph_WireId theA, const BRepGraph_WireId theB) -> bool { - NCollection_Vector aWireACoEdges; - NCollection_Vector aWireBCoEdges; + NCollection_DynamicArray aWireACoEdges; + NCollection_DynamicArray aWireBCoEdges; for (BRepGraph_RefsCoEdgeOfWire aCEIt(theGraph, theA); aCEIt.More(); aCEIt.Next()) { aWireACoEdges.Append(theGraph.Refs().CoEdges().Entry(aCEIt.CurrentId()).CoEdgeDefId); @@ -524,8 +523,8 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG if (aWireACoEdges.Size() != aWireBCoEdges.Size()) return false; - NCollection_Vector::Iterator anItA(aWireACoEdges); - NCollection_Vector::Iterator anItB(aWireBCoEdges); + NCollection_DynamicArray::Iterator anItA(aWireACoEdges); + NCollection_DynamicArray::Iterator anItB(aWireBCoEdges); for (; anItA.More(); anItA.Next(), anItB.Next()) { const BRepGraphInc::CoEdgeDef& aCoEdgeA = @@ -539,7 +538,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG return true; }; - NCollection_DataMap> aWireHashBuckets( + NCollection_DataMap> aWireHashBuckets( std::max(1, theGraph.Topo().Wires().Nb()), aTmpAlloc); @@ -551,7 +550,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG if (aWire.IsRemoved) continue; const size_t aH = aHasher(aWireId, theGraph); - aWireHashBuckets.TryBind(aH, NCollection_Vector()); + aWireHashBuckets.TryBind(aH, NCollection_DynamicArray()); aWireHashBuckets.ChangeFind(aH).Append(aWireId); } @@ -559,12 +558,12 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG std::max(1, theGraph.Topo().Wires().Nb()), aTmpAlloc); - for (NCollection_DataMap>::Iterator aBucketIter( - aWireHashBuckets); + for (NCollection_DataMap>::Iterator + aBucketIter(aWireHashBuckets); aBucketIter.More(); aBucketIter.Next()) { - const NCollection_Vector& aBucket = aBucketIter.Value(); + const NCollection_DynamicArray& aBucket = aBucketIter.Value(); for (size_t aBaseIdx = 0; aBaseIdx < aBucket.Size(); ++aBaseIdx) { const BRepGraph_WireId aBaseWireId = aBucket.Value(aBaseIdx); @@ -708,9 +707,8 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG return aHash; }; - NCollection_DataMap, FaceKeyHasher> aFaceGroups( - std::max(1, theGraph.Topo().Faces().Nb()), - aTmpAlloc); + NCollection_DataMap, FaceKeyHasher> + aFaceGroups(std::max(1, theGraph.Topo().Faces().Nb()), aTmpAlloc); for (BRepGraph_FullFaceIterator aFaceIt(theGraph); aFaceIt.More(); aFaceIt.Next()) { @@ -723,7 +721,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG aKey.SurfPtr = BRepGraph_Tool::Face::Surface(theGraph, aFaceId).get(); aKey.WireHash = faceWireHash(aFaceId); - aFaceGroups.TryBind(aKey, NCollection_Vector()); + aFaceGroups.TryBind(aKey, NCollection_DynamicArray()); aFaceGroups.ChangeFind(aKey).Append(aFaceId); } @@ -731,12 +729,12 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG std::max(1, theGraph.Topo().Faces().Nb()), aTmpAlloc); - for (NCollection_DataMap, FaceKeyHasher>::Iterator - aGroupIter(aFaceGroups); + for (NCollection_DataMap, FaceKeyHasher>:: + Iterator aGroupIter(aFaceGroups); aGroupIter.More(); aGroupIter.Next()) { - const NCollection_Vector& aGroup = aGroupIter.Value(); + const NCollection_DynamicArray& aGroup = aGroupIter.Value(); if (aGroup.Size() < 2) continue; @@ -799,7 +797,7 @@ BRepGraph_Deduplicate::Result BRepGraph_Deduplicate::Perform(BRepGraph& theG theGraph.Editor().Gen().RemoveNode(anOldId, aCanonId); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(aCanonId); theGraph.History().Record(TCollection_AsciiString("Dedup:MergeFace"), anOldId, aRepl); ++aResult.NbHistoryRecords; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.hxx index 4ec5a2f8d2..2387356bbf 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Deduplicate.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -61,8 +61,8 @@ public: int NbMergedWires = 0; int NbMergedFaces = 0; - NCollection_Vector AffectedFaces; //!< Faces whose SurfNodeId changed. - NCollection_Vector AffectedEdges; //!< Edges whose CurveNodeId changed. + NCollection_DynamicArray AffectedFaces; //!< Faces whose SurfNodeId changed. + NCollection_DynamicArray AffectedEdges; //!< Edges whose CurveNodeId changed. }; //! Run deduplication on a built graph. diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_DefsIterator.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_DefsIterator.hxx index e6063b8e94..3ea84451e3 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_DefsIterator.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_DefsIterator.hxx @@ -71,8 +71,8 @@ struct ShellOfSolidTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Solids().Definition(theParent).ShellRefIds; } @@ -105,8 +105,8 @@ struct FaceOfShellTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Shells().Definition(theParent).FaceRefIds; } @@ -139,8 +139,8 @@ struct ChildOfShellTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Shells().Definition(theParent).AuxChildRefIds; } @@ -173,8 +173,8 @@ struct WireOfFaceTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Faces().Definition(theParent).WireRefIds; } @@ -207,8 +207,8 @@ struct VertexOfFaceTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Faces().Definition(theParent).VertexRefIds; } @@ -241,8 +241,8 @@ struct CoEdgeOfWireTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Wires().Definition(theParent).CoEdgeRefIds; } @@ -275,8 +275,8 @@ struct EdgeOfWireTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Wires().Definition(theParent).CoEdgeRefIds; } @@ -320,8 +320,8 @@ struct SolidOfCompSolidTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().CompSolids().Definition(theParent).SolidRefIds; } @@ -354,8 +354,8 @@ struct ChildOfSolidTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Solids().Definition(theParent).AuxChildRefIds; } @@ -388,8 +388,8 @@ struct ChildOfCompoundTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Compounds().Definition(theParent).ChildRefIds; } @@ -422,8 +422,8 @@ struct OccurrenceOfProductTraits : public BaseTraits& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Products().Definition(theParent).OccurrenceRefIds; } @@ -513,10 +513,10 @@ private: } } - const BRepGraph& myGraph; - const NCollection_Vector* myRefIds = nullptr; - uint32_t myIndex = 0; - uint32_t myLength = 0; + const BRepGraph& myGraph; + const NCollection_DynamicArray* myRefIds = nullptr; + uint32_t myIndex = 0; + uint32_t myLength = 0; }; //! @brief Direct active vertex children of an edge. diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.cxx index 6705b1bcb2..a6c4c17206 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.cxx @@ -73,10 +73,10 @@ bool hasOtherActiveParent(const BRepGraph& theGraph, return false; } -void removeFromRootProducts(NCollection_Vector& theRoots, - const BRepGraph_ProductId theProduct) +void removeFromRootProducts(NCollection_DynamicArray& theRoots, + const BRepGraph_ProductId theProduct) { - NCollection_Vector aFiltered; + NCollection_DynamicArray aFiltered; for (const BRepGraph_ProductId& aRoot : theRoots) { if (aRoot != theProduct) @@ -109,9 +109,10 @@ bool hasAnyActiveUsage(const BRepGraph& theGraph, const BRepGraph_NodeId theChil } template -RefIdT findOrderedRef(const NCollection_Vector& theRefIds, const RefIdT theRefId) +RefIdT findOrderedRef(const NCollection_DynamicArray& theRefIds, const RefIdT theRefId) { - for (typename NCollection_Vector::Iterator anIt(theRefIds); anIt.More(); anIt.Next()) + for (typename NCollection_DynamicArray::Iterator anIt(theRefIds); anIt.More(); + anIt.Next()) { if (anIt.Value() == theRefId) return theRefId; @@ -120,10 +121,10 @@ RefIdT findOrderedRef(const NCollection_Vector& theRefIds, const RefIdT } template -void eraseOrderedRef(const RefIdT theRefId, NCollection_Vector& theRefIds) +void eraseOrderedRef(const RefIdT theRefId, NCollection_DynamicArray& theRefIds) { uint32_t anIndex = 0; - for (typename NCollection_Vector::Iterator anIt(theRefIds); anIt.More(); + for (typename NCollection_DynamicArray::Iterator anIt(theRefIds); anIt.More(); anIt.Next(), ++anIndex) { if (anIt.Value() == theRefId) @@ -138,11 +139,11 @@ void eraseOrderedRef(const RefIdT theRefId, NCollection_Vector& theRefId } template -bool detachOrderedParentRef(BRepGraph& theGraph, - const RefIdT theRefId, - NCollection_Vector& theParentRefIds, - const BRepGraph_NodeId theChildNode, - const bool theToPruneOrphanedChild) +bool detachOrderedParentRef(BRepGraph& theGraph, + const RefIdT theRefId, + NCollection_DynamicArray& theParentRefIds, + const BRepGraph_NodeId theChildNode, + const bool theToPruneOrphanedChild) { if (!findOrderedRef(theParentRefIds, theRefId).IsValid()) { @@ -324,7 +325,7 @@ static void rebindCoEdgesForEdgeReplacement(BRepGraphInc_Storage& theStorage, const BRepGraph_EdgeId theSourceEdgeId, const BRepGraph_EdgeId theReplacementEdgeId) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = theStorage.ReverseIndex().CoEdgesOfEdgeRef(theSourceEdgeId); const uint32_t aNbCoEdges = static_cast(aCoEdgeIdxs.Size()); NCollection_LocalArray aCoEdgeSnapshot(aNbCoEdges); @@ -354,7 +355,7 @@ static void rebindCoEdgesForEdgeReplacement(BRepGraphInc_Storage& theStorage, static void unbindCoEdgesOfRemovedEdge(BRepGraphInc_Storage& theStorage, const BRepGraph_EdgeId theEdgeId) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = theStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdgeId); const uint32_t aNbCoEdges = static_cast(aCoEdgeIdxs.Size()); NCollection_LocalArray aCoEdgeSnapshot(aNbCoEdges); @@ -446,7 +447,7 @@ int cachedActiveByKind(const BRepGraphInc_Storage& theStorage, const BRepGraph_N return 0; } -[[maybe_unused]] const NCollection_Vector& wireCoEdgeRefIds( +[[maybe_unused]] const NCollection_DynamicArray& wireCoEdgeRefIds( const BRepGraphInc_Storage& theStorage, const BRepGraph_WireId theWireId) { @@ -577,7 +578,7 @@ BRepGraph_EdgeId BRepGraph::EditorView::EdgeOps::Add(const BRepGraph_VertexId //================================================================================================= BRepGraph_WireId BRepGraph::EditorView::WireOps::Add( - const NCollection_Vector>& theEdges) + const NCollection_DynamicArray>& theEdges) { BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; for (const std::pair& anEdgeEntry : theEdges) @@ -677,10 +678,10 @@ BRepGraph_VertexRefId BRepGraph::EditorView::EdgeOps::AddInternalVertex( //================================================================================================= BRepGraph_FaceId BRepGraph::EditorView::FaceOps::Add( - const occ::handle& theSurface, - const BRepGraph_WireId theOuterWire, - const NCollection_Vector& theInnerWires, - const double theTolerance) + const occ::handle& theSurface, + const BRepGraph_WireId theOuterWire, + const NCollection_DynamicArray& theInnerWires, + const double theTolerance) { BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; if (theOuterWire.IsValid() && !isActiveNode(aStorage, theOuterWire)) @@ -909,7 +910,7 @@ BRepGraph_ChildRefId BRepGraph::EditorView::SolidOps::AddChild( //================================================================================================= BRepGraph_CompoundId BRepGraph::EditorView::CompoundOps::Add( - const NCollection_Vector& theChildEntities) + const NCollection_DynamicArray& theChildEntities) { BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; for (const BRepGraph_NodeId& aChild : theChildEntities) @@ -942,7 +943,7 @@ BRepGraph_CompoundId BRepGraph::EditorView::CompoundOps::Add( //================================================================================================= BRepGraph_CompSolidId BRepGraph::EditorView::CompSolidOps::Add( - const NCollection_Vector& theSolidEntities) + const NCollection_DynamicArray& theSolidEntities) { BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; for (const BRepGraph_SolidId& aSolidId : theSolidEntities) @@ -1234,7 +1235,7 @@ void BRepGraph::EditorView::GenOps::RemoveSubgraph(const BRepGraph_NodeId theNod { // Snapshot occurrence indices before iterating, because RemoveSubgraph(Occurrence) // modifies the parent's OccurrenceRefIds via swap-remove. - NCollection_Vector anOccIndices; + NCollection_DynamicArray anOccIndices; for (BRepGraph_RefsOccurrenceOfProduct anOccIt(*myGraph, BRepGraph_ProductId::FromNodeId(theNode)); anOccIt.More(); @@ -1274,10 +1275,11 @@ void BRepGraph::EditorView::GenOps::RemoveSubgraph(const BRepGraph_NodeId theNod if (!aParentProduct.IsValid(aStorage.NbProducts())) break; - NCollection_Vector& aRefIds = + NCollection_DynamicArray& aRefIds = myGraph->myData->myIncStorage.ChangeProduct(aParentProduct).OccurrenceRefIds; uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aRefIds); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aRefIds); + anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == aOccRefId) @@ -1314,7 +1316,7 @@ void BRepGraph::EditorView::GenOps::RemoveSubgraph(const BRepGraph_NodeId theNod default: { // Generic topology cascade via ChildExplorer(DirectChildren) + ParentExplorer(DirectParents). // Covers Compound, CompSolid, Solid, Shell, Face, Wire, CoEdge, Edge, Vertex. - NCollection_Vector aChildNodes; + NCollection_DynamicArray aChildNodes; for (BRepGraph_ChildExplorer anExp(*myGraph, theNode, BRepGraph_ChildExplorer::TraversalMode::DirectChildren); @@ -1475,7 +1477,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept myGraph->myData->myDeferredMode.store(false, std::memory_order_relaxed); - NCollection_Vector& aDeferredList = myGraph->myData->myDeferredModified; + NCollection_DynamicArray& aDeferredList = myGraph->myData->myDeferredModified; if (aDeferredList.IsEmpty()) return; @@ -1533,7 +1535,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept // BFS-style upward propagation: process nodes front-to-back, appending // newly discovered parents at the end. The loop index advances through // the growing vector, so each node is visited exactly once. - NCollection_Vector aAllModified; + NCollection_DynamicArray aAllModified; aAllModified.SetIncrement(aDeferredList.Size() * 2); int aModifiedKindsMask = 0; @@ -1564,7 +1566,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept // Vertex modifications don't propagate in deferred mode. break; case BRepGraph_NodeId::Kind::Edge: { - const NCollection_Vector* aWires = + const NCollection_DynamicArray* aWires = aRevIdx.WiresOfEdge(BRepGraph_EdgeId(aNodeId)); if (aWires != nullptr) for (const BRepGraph_WireId& aWireId : *aWires) @@ -1584,7 +1586,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept case BRepGraph_NodeId::Kind::CoEdge: break; case BRepGraph_NodeId::Kind::Wire: { - const NCollection_Vector* aFaces = + const NCollection_DynamicArray* aFaces = aRevIdx.FacesOfWire(BRepGraph_WireId(aNodeId)); if (aFaces != nullptr) for (const BRepGraph_FaceId& aFaceId : *aFaces) @@ -1602,7 +1604,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept break; } case BRepGraph_NodeId::Kind::Face: { - const NCollection_Vector* aShells = + const NCollection_DynamicArray* aShells = aRevIdx.ShellsOfFace(BRepGraph_FaceId(aNodeId)); if (aShells != nullptr) for (const BRepGraph_ShellId& aShellId : *aShells) @@ -1620,7 +1622,7 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept break; } case BRepGraph_NodeId::Kind::Shell: { - const NCollection_Vector* aSolids = + const NCollection_DynamicArray* aSolids = aRevIdx.SolidsOfShell(BRepGraph_ShellId(aNodeId)); if (aSolids != nullptr) for (const BRepGraph_SolidId& aSolidId : *aSolids) @@ -1677,7 +1679,8 @@ void BRepGraph::EditorView::EndDeferredInvalidation() noexcept aDeferredList.Clear(); // Dispatch deferred reference modification events to subscribing layers. - NCollection_Vector& aDeferredRefList = myGraph->myData->myDeferredRefModified; + NCollection_DynamicArray& aDeferredRefList = + myGraph->myData->myDeferredRefModified; if (!aDeferredRefList.IsEmpty() && myGraph->myLayerRegistry.HasRefModificationSubscribers()) { int aRefKindsMask = 0; @@ -1700,9 +1703,9 @@ bool BRepGraph::EditorView::IsDeferredMode() const //================================================================================================= void BRepGraph::EditorView::GenOps::applyModificationImpl( - const BRepGraph_NodeId theTarget, - NCollection_Vector&& theReplacements, - const TCollection_AsciiString& theOpLabel) + const BRepGraph_NodeId theTarget, + NCollection_DynamicArray&& theReplacements, + const TCollection_AsciiString& theOpLabel) { myGraph->myData->myHistoryLog.Record(theOpLabel, theTarget, theReplacements); myGraph->invalidateSubgraphImpl(theTarget); @@ -1754,10 +1757,10 @@ void BRepGraph::EditorView::EdgeOps::Split(const BRepGraph_EdgeId theEdgeEntit : BRepGraph_VertexId(); // Copy wire indices: ReverseIdx may be rebuilt below. - const NCollection_Vector* aOrigWiresPtr = + const NCollection_DynamicArray* aOrigWiresPtr = myGraph->myData->myIncStorage.ReverseIndex().WiresOfEdge(theEdgeEntity); - const NCollection_Vector aOrigWires = - aOrigWiresPtr != nullptr ? *aOrigWiresPtr : NCollection_Vector(); + const NCollection_DynamicArray aOrigWires = + aOrigWiresPtr != nullptr ? *aOrigWiresPtr : NCollection_DynamicArray(); BRepGraphInc_Storage& aMutStorage = myGraph->myData->myIncStorage; @@ -1883,14 +1886,14 @@ void BRepGraph::EditorView::EdgeOps::Split(const BRepGraph_EdgeId theEdgeEntit // allocates two fully-initialised CoEdges per original, rebuilds SeamPairId // on the new pairs, rebuilds wire CoEdgeRefIds, and retires each original // CoEdge with a reverse-index unbind. - NCollection_Vector aOrigFaces; + NCollection_DynamicArray aOrigFaces; { BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; BRepGraphInc_ReverseIndex& aRevIdx = aStorage.ChangeReverseIndex(); // Step 1: snapshot old CoEdge ids before any mutation. - NCollection_Vector anOrigCoEdgeIds; - if (const NCollection_Vector* aSrc = + NCollection_DynamicArray anOrigCoEdgeIds; + if (const NCollection_DynamicArray* aSrc = aStorage.ReverseIndex().CoEdgesOfEdge(theEdgeEntity)) { for (const BRepGraph_CoEdgeId& anId : *aSrc) @@ -1900,8 +1903,8 @@ void BRepGraph::EditorView::EdgeOps::Split(const BRepGraph_EdgeId theEdgeEntit // Step 2: allocate SubA-CE + SubB-CE per original with full payload. NCollection_DataMap aIdxOf; - NCollection_Vector aNewACoEdgeIds; - NCollection_Vector aNewBCoEdgeIds; + NCollection_DynamicArray aNewACoEdgeIds; + NCollection_DynamicArray aNewBCoEdgeIds; const double aParamRange = aOrigParamLast - aOrigParamFirst; for (uint32_t i = 0; i < aNbOrig; ++i) { @@ -1994,10 +1997,11 @@ void BRepGraph::EditorView::EdgeOps::Split(const BRepGraph_EdgeId theEdgeEntit // land at the correct position in the growing list. for (const BRepGraph_WireId& aWireId : aOrigWires) { - NCollection_Vector aSnapshot; + NCollection_DynamicArray aSnapshot; { const BRepGraphInc::WireDef& aWireDef = aStorage.Wire(aWireId); - for (NCollection_Vector::Iterator aRefIt(aWireDef.CoEdgeRefIds); + for (NCollection_DynamicArray::Iterator aRefIt( + aWireDef.CoEdgeRefIds); aRefIt.More(); aRefIt.Next()) { @@ -2079,7 +2083,7 @@ void BRepGraph::EditorView::EdgeOps::Split(const BRepGraph_EdgeId theEdgeEntit // moment a caller does populate them. { const BRepGraphInc::EdgeDef& aOrigEdgeRef = aStorage.Edge(theEdgeEntity); - for (NCollection_Vector::Iterator anIntRefIt( + for (NCollection_DynamicArray::Iterator anIntRefIt( aOrigEdgeRef.InternalVertexRefIds); anIntRefIt.More(); anIntRefIt.Next()) @@ -2231,7 +2235,7 @@ void BRepGraph::EditorView::WireOps::ReplaceEdge(const BRepGraph_WireId theWireD // Update edge-to-face: bind new edge, unbind old edge for all faces of this wire. // Wire-to-face mappings are built from FaceDef.WireRefs during BRepGraph_Builder::Perform() // and are stable across edge mutations - only face-level operations modify them. - const NCollection_Vector* aFaces = aRevIdx.FacesOfWire(theWireDefId); + const NCollection_DynamicArray* aFaces = aRevIdx.FacesOfWire(theWireDefId); if (aFaces != nullptr) { for (const BRepGraph_FaceId& aFaceId : *aFaces) @@ -2280,7 +2284,7 @@ bool BRepGraph::EditorView::CompoundOps::RemoveChild(const BRepGraph_CompoundId return false; } - NCollection_Vector& aCompoundRefIds = + NCollection_DynamicArray& aCompoundRefIds = aStorage.ChangeCompound(theCompoundDefId).ChildRefIds; if (!detachOrderedParentRef(*myGraph, theChildRefId, aCompoundRefIds, aRef.ChildDefId, true)) { @@ -2326,7 +2330,7 @@ bool BRepGraph::EditorView::ProductOps::RemoveOccurrence( return false; } - NCollection_Vector& aProductRefIds = + NCollection_DynamicArray& aProductRefIds = aStorage.ChangeProduct(theProductDefId).OccurrenceRefIds; if (!detachOrderedParentRef(*myGraph, theOccurrenceRefId, @@ -2450,7 +2454,7 @@ bool BRepGraph::EditorView::ShellOps::RemoveChild(const BRepGraph_ShellId the return false; } - NCollection_Vector& aShellRefIds = + NCollection_DynamicArray& aShellRefIds = aStorage.ChangeShell(theShellDefId).AuxChildRefIds; if (!detachOrderedParentRef(*myGraph, theChildRefId, aShellRefIds, aRef.ChildDefId, true)) { @@ -2494,7 +2498,7 @@ bool BRepGraph::EditorView::SolidOps::RemoveChild(const BRepGraph_SolidId the return false; } - NCollection_Vector& aSolidRefIds = + NCollection_DynamicArray& aSolidRefIds = aStorage.ChangeSolid(theSolidDefId).AuxChildRefIds; if (!detachOrderedParentRef(*myGraph, theChildRefId, aSolidRefIds, aRef.ChildDefId, true)) { @@ -2538,7 +2542,7 @@ bool BRepGraph::EditorView::CompSolidOps::RemoveSolid(const BRepGraph_CompSolidI return false; } - NCollection_Vector& aCompSolidRefIds = + NCollection_DynamicArray& aCompSolidRefIds = aStorage.ChangeCompSolid(theCompSolidDefId).SolidRefIds; if (!detachOrderedParentRef(*myGraph, theSolidRefId, @@ -2586,7 +2590,7 @@ bool BRepGraph::EditorView::SolidOps::RemoveShell(const BRepGraph_SolidId the return false; } - NCollection_Vector& aSolidRefIds = + NCollection_DynamicArray& aSolidRefIds = aStorage.ChangeSolid(theSolidDefId).ShellRefIds; if (!detachOrderedParentRef(*myGraph, theShellRefId, @@ -2634,7 +2638,7 @@ bool BRepGraph::EditorView::ShellOps::RemoveFace(const BRepGraph_ShellId theSh return false; } - NCollection_Vector& aShellRefIds = + NCollection_DynamicArray& aShellRefIds = aStorage.ChangeShell(theShellDefId).FaceRefIds; if (!detachOrderedParentRef(*myGraph, theFaceRefId, @@ -2682,7 +2686,7 @@ bool BRepGraph::EditorView::FaceOps::RemoveVertex(const BRepGraph_FaceId th return false; } - NCollection_Vector& aFaceRefIds = + NCollection_DynamicArray& aFaceRefIds = aStorage.ChangeFace(theFaceDefId).VertexRefIds; if (!detachOrderedParentRef(*myGraph, theVertexRefId, @@ -2730,7 +2734,7 @@ bool BRepGraph::EditorView::FaceOps::RemoveWire(const BRepGraph_FaceId theFac return false; } - NCollection_Vector& aFaceRefIds = + NCollection_DynamicArray& aFaceRefIds = aStorage.ChangeFace(theFaceDefId).WireRefIds; if (!detachOrderedParentRef(*myGraph, theWireRefId, @@ -2783,7 +2787,7 @@ bool BRepGraph::EditorView::WireOps::RemoveCoEdge(const BRepGraph_WireId th const BRepGraph_EdgeId anEdgeId = aCoEdgeDef.EdgeDefId; const BRepGraph_FaceId aFaceId = aCoEdgeDef.FaceDefId; - NCollection_Vector& aWireRefIds = + NCollection_DynamicArray& aWireRefIds = aStorage.ChangeWire(theWireDefId).CoEdgeRefIds; if (!detachOrderedParentRef(*myGraph, theCoEdgeRefId, @@ -2825,7 +2829,7 @@ bool BRepGraph::EditorView::WireOps::RemoveCoEdge(const BRepGraph_WireId th return false; } - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aStorage.ReverseIndex().CoEdgesOfEdgeRef(anEdgeId); for (const BRepGraph_CoEdgeId& aCandidateId : aCoEdges) { @@ -2925,8 +2929,8 @@ bool BRepGraph::EditorView::EdgeOps::RemoveVertex(const BRepGraph_EdgeId th } else { - NCollection_Vector& anEdgeRefIds = aEdge.InternalVertexRefIds; - isFound = detachOrderedParentRef(*myGraph, + NCollection_DynamicArray& anEdgeRefIds = aEdge.InternalVertexRefIds; + isFound = detachOrderedParentRef(*myGraph, theVertexRefId, anEdgeRefIds, BRepGraph_NodeId(aRef.VertexDefId), @@ -3017,7 +3021,8 @@ BRepGraph_VertexRefId BRepGraph::EditorView::EdgeOps::ReplaceVertex( else { bool isFound = false; - for (NCollection_Vector::Iterator anIt(anEdge.InternalVertexRefIds); + for (NCollection_DynamicArray::Iterator anIt( + anEdge.InternalVertexRefIds); anIt.More(); anIt.Next()) { @@ -3061,8 +3066,8 @@ BRepGraph_VertexRefId BRepGraph::EditorView::EdgeOps::ReplaceVertex( void BRepGraph::EditorView::CommitMutation() noexcept { - NCollection_Vector anIssues; - const bool isValid = ValidateMutationBoundary(&anIssues); + NCollection_DynamicArray anIssues; + const bool isValid = ValidateMutationBoundary(&anIssues); Standard_ASSERT_VOID(isValid, "CommitMutation: mutation boundary consistency check failed"); (void)isValid; (void)anIssues; @@ -3071,7 +3076,7 @@ void BRepGraph::EditorView::CommitMutation() noexcept //================================================================================================= bool BRepGraph::EditorView::ValidateMutationBoundary( - NCollection_Vector* const theIssues) const + NCollection_DynamicArray* const theIssues) const { bool isValid = true; const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.hxx index 98a80808d8..4e229b4d48 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_EditorView.hxx @@ -290,8 +290,8 @@ public: //! @param[in] theEdges ordered edge entries //! @return typed wire definition identifier, or invalid if any referenced //! edge entry is invalid - [[nodiscard]] Standard_EXPORT BRepGraph_WireId - Add(const NCollection_Vector>& theEdges); + [[nodiscard]] Standard_EXPORT BRepGraph_WireId Add( + const NCollection_DynamicArray>& theEdges); //! Replace one edge with another in a wire definition. //! Updates the CoEdge's EdgeIdx to point to the new edge, adjusts orientation @@ -347,10 +347,10 @@ public: //! @return typed face definition identifier, or invalid if any referenced //! wire id is out of range or removed [[nodiscard]] Standard_EXPORT BRepGraph_FaceId - Add(const occ::handle& theSurface, - const BRepGraph_WireId theOuterWire, - const NCollection_Vector& theInnerWires, - const double theTolerance); + Add(const occ::handle& theSurface, + const BRepGraph_WireId theOuterWire, + const NCollection_DynamicArray& theInnerWires, + const double theTolerance); //! Add a direct INTERNAL/EXTERNAL vertex usage to a face definition. //! @param[in] theFaceEntity typed face definition identifier @@ -545,7 +545,7 @@ public: //! @param[in] theChildEntities child definition NodeIds //! @return typed compound definition identifier [[nodiscard]] Standard_EXPORT BRepGraph_CompoundId - Add(const NCollection_Vector& theChildEntities); + Add(const NCollection_DynamicArray& theChildEntities); //! Detach one exact child ref from a compound definition. //! Use BRepGraph_RefsChildOfParent::CurrentId() when removing from a compound @@ -581,7 +581,7 @@ public: //! @param[in] theSolidEntities typed child solid definition identifiers //! @return typed compsolid definition identifier [[nodiscard]] Standard_EXPORT BRepGraph_CompSolidId - Add(const NCollection_Vector& theSolidEntities); + Add(const NCollection_DynamicArray& theSolidEntities); //! Detach one exact solid ref from a compsolid definition. //! Use BRepGraph_RefsSolidOfCompSolid::CurrentId() when removing from a @@ -767,7 +767,7 @@ public: ModifierT&& theModifier, const TCollection_AsciiString& theOpLabel) { - NCollection_Vector aReplacements = + NCollection_DynamicArray aReplacements = std::forward(theModifier)(*myGraph, theTarget); applyModificationImpl(theTarget, std::move(aReplacements), theOpLabel); } @@ -781,9 +781,9 @@ public: } Standard_EXPORT void applyModificationImpl( - const BRepGraph_NodeId theTarget, - NCollection_Vector&& theReplacements, - const TCollection_AsciiString& theOpLabel); + const BRepGraph_NodeId theTarget, + NCollection_DynamicArray&& theReplacements, + const TCollection_AsciiString& theOpLabel); BRepGraph* myGraph; }; @@ -889,7 +889,7 @@ public: //! @param[out] theIssues optional destination for detailed issues //! @return true if no issues were found [[nodiscard]] Standard_EXPORT bool ValidateMutationBoundary( - NCollection_Vector* const theIssues = nullptr) const; + NCollection_DynamicArray* const theIssues = nullptr) const; private: friend class BRepGraph; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.cxx index 20fec73575..0ac230c451 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.cxx @@ -33,17 +33,18 @@ void BRepGraph_History::SetAllocator(const occ::handle(THE_HISTORY_RECORD_BLOCK_SIZE, myAllocator); + NCollection_DynamicArray(THE_HISTORY_RECORD_BLOCK_SIZE, myAllocator); myDerivedToOriginal = NCollection_DataMap(1, myAllocator); myOriginalToDerived = - NCollection_DataMap>(1, myAllocator); + NCollection_DataMap>(1, + myAllocator); } //================================================================================================= -void BRepGraph_History::Record(const TCollection_AsciiString& theOpLabel, - const BRepGraph_NodeId theOriginal, - const NCollection_Vector& theReplacements) +void BRepGraph_History::Record(const TCollection_AsciiString& theOpLabel, + const BRepGraph_NodeId theOriginal, + const NCollection_DynamicArray& theReplacements) { if (!myEnabled) { @@ -57,7 +58,9 @@ void BRepGraph_History::Record(const TCollection_AsciiString& theOp if (!myAllocator.IsNull()) { aRecord.Mapping = - NCollection_DataMap>(1, myAllocator); + NCollection_DataMap>( + 1, + myAllocator); } aRecord.Mapping.Bind(theOriginal, theReplacements); myRecords.Append(std::move(aRecord)); @@ -65,8 +68,8 @@ void BRepGraph_History::Record(const TCollection_AsciiString& theOp // Populate the bidirectional lookup maps. // Skip self-referencing entries (aDerived == theOriginal) to avoid overwriting // prior chain links in the reverse map. - NCollection_Vector aFilteredReplacements(THE_HISTORY_FILTERED_BLOCK_SIZE, - myAllocator); + NCollection_DynamicArray aFilteredReplacements(THE_HISTORY_FILTERED_BLOCK_SIZE, + myAllocator); for (const BRepGraph_NodeId& aDerived : theReplacements) { if (aDerived != theOriginal) @@ -81,7 +84,8 @@ void BRepGraph_History::Record(const TCollection_AsciiString& theOp if (myOriginalToDerived.IsBound(theOriginal)) { - NCollection_Vector& aDerivedVec = myOriginalToDerived.ChangeFind(theOriginal); + NCollection_DynamicArray& aDerivedVec = + myOriginalToDerived.ChangeFind(theOriginal); for (const BRepGraph_NodeId& aDerived : aFilteredReplacements) { aDerivedVec.Append(aDerived); @@ -95,10 +99,11 @@ void BRepGraph_History::Record(const TCollection_AsciiString& theOp //================================================================================================= -void BRepGraph_History::RecordBatch(const TCollection_AsciiString& theOpLabel, - const NCollection_Vector& theOriginals, - const NCollection_Vector& theReplacements, - const TCollection_AsciiString& theExtraInfo) +void BRepGraph_History::RecordBatch( + const TCollection_AsciiString& theOpLabel, + const NCollection_DynamicArray& theOriginals, + const NCollection_DynamicArray& theReplacements, + const TCollection_AsciiString& theExtraInfo) { Standard_ASSERT_VOID(theOriginals.Size() == theReplacements.Size(), "RecordBatch: mismatched vector lengths"); @@ -117,8 +122,9 @@ void BRepGraph_History::RecordBatch(const TCollection_AsciiString& if (!myAllocator.IsNull()) { aRecord.Mapping = - NCollection_DataMap>(aNbPairs, - myAllocator); + NCollection_DataMap>( + aNbPairs, + myAllocator); } else { @@ -128,15 +134,16 @@ void BRepGraph_History::RecordBatch(const TCollection_AsciiString& // Build mapping: each pair creates a 1-element replacement vector. { - NCollection_Vector::Iterator anOrigIt(theOriginals); - NCollection_Vector::Iterator aReplIt(theReplacements); + NCollection_DynamicArray::Iterator anOrigIt(theOriginals); + NCollection_DynamicArray::Iterator aReplIt(theReplacements); for (; anOrigIt.More(); anOrigIt.Next(), aReplIt.Next()) { const BRepGraph_NodeId& anOriginal = anOrigIt.Value(); const BRepGraph_NodeId& aReplacement = aReplIt.Value(); Standard_ASSERT_VOID(!aRecord.Mapping.IsBound(anOriginal), "RecordBatch: duplicate original node"); - NCollection_Vector aRepVec(THE_HISTORY_REPLACEMENT_BLOCK_SIZE, myAllocator); + NCollection_DynamicArray aRepVec(THE_HISTORY_REPLACEMENT_BLOCK_SIZE, + myAllocator); aRepVec.Append(aReplacement); aRecord.Mapping.Bind(anOriginal, std::move(aRepVec)); } @@ -149,8 +156,8 @@ void BRepGraph_History::RecordBatch(const TCollection_AsciiString& myOriginalToDerived.ReSize(myOriginalToDerived.Extent() + aNbPairs); { - NCollection_Vector::Iterator anOrigIt(theOriginals); - NCollection_Vector::Iterator aReplIt(theReplacements); + NCollection_DynamicArray::Iterator anOrigIt(theOriginals); + NCollection_DynamicArray::Iterator aReplIt(theReplacements); for (; anOrigIt.More(); anOrigIt.Next(), aReplIt.Next()) { const BRepGraph_NodeId& anOriginal = anOrigIt.Value(); @@ -168,8 +175,8 @@ void BRepGraph_History::RecordBatch(const TCollection_AsciiString& } else { - NCollection_Vector aDerVec(THE_HISTORY_REPLACEMENT_BLOCK_SIZE, - myAllocator); + NCollection_DynamicArray aDerVec(THE_HISTORY_REPLACEMENT_BLOCK_SIZE, + myAllocator); aDerVec.Append(aReplacement); myOriginalToDerived.Bind(anOriginal, std::move(aDerVec)); } @@ -199,14 +206,14 @@ BRepGraph_NodeId BRepGraph_History::FindOriginal(const BRepGraph_NodeId theModif //================================================================================================= -NCollection_Vector BRepGraph_History::FindDerived( +NCollection_DynamicArray BRepGraph_History::FindDerived( const BRepGraph_NodeId theOriginal) const { // Collect all transitively derived nodes using iterative BFS. // A visited set guards against infinite loops if cycles exist in the forward map. - NCollection_Vector aResult(THE_HISTORY_DERIVED_BLOCK_SIZE); - NCollection_Vector aQueue(THE_HISTORY_QUEUE_BLOCK_SIZE); - NCollection_Map aVisited; + NCollection_DynamicArray aResult(THE_HISTORY_DERIVED_BLOCK_SIZE); + NCollection_DynamicArray aQueue(THE_HISTORY_QUEUE_BLOCK_SIZE); + NCollection_Map aVisited; aQueue.Append(theOriginal); aVisited.Add(theOriginal); @@ -225,7 +232,8 @@ NCollection_Vector BRepGraph_History::FindDerived( continue; } - const NCollection_Vector& aDirectDerived = myOriginalToDerived.Find(aNode); + const NCollection_DynamicArray& aDirectDerived = + myOriginalToDerived.Find(aNode); for (const BRepGraph_NodeId& aDerived : aDirectDerived) { if (aVisited.Add(aDerived)) @@ -239,7 +247,7 @@ NCollection_Vector BRepGraph_History::FindDerived( // return the direct derived for the non-recursive case. if (aResult.IsEmpty() && myOriginalToDerived.IsBound(theOriginal)) { - const NCollection_Vector& aDirectDerived = + const NCollection_DynamicArray& aDirectDerived = myOriginalToDerived.Find(theOriginal); for (const BRepGraph_NodeId& aDerived : aDirectDerived) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.hxx index f5a385a2be..931992fbb7 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_History.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -40,9 +40,9 @@ public: //! @param[in] theOpLabel human-readable operation name //! @param[in] theOriginal node id before the operation //! @param[in] theReplacements node ids after the operation - Standard_EXPORT void Record(const TCollection_AsciiString& theOpLabel, - const BRepGraph_NodeId theOriginal, - const NCollection_Vector& theReplacements); + Standard_EXPORT void Record(const TCollection_AsciiString& theOpLabel, + const BRepGraph_NodeId theOriginal, + const NCollection_DynamicArray& theReplacements); //! Record a batch of 1-to-1 modifications in a single history event. //! theOriginals[i] was replaced by theReplacements[i]. @@ -53,10 +53,10 @@ public: //! @param[in] theReplacements node ids after the operation (same length) //! @param[in] theExtraInfo optional diagnostic info stored on the record Standard_EXPORT void RecordBatch( - const TCollection_AsciiString& theOpLabel, - const NCollection_Vector& theOriginals, - const NCollection_Vector& theReplacements, - const TCollection_AsciiString& theExtraInfo = TCollection_AsciiString()); + const TCollection_AsciiString& theOpLabel, + const NCollection_DynamicArray& theOriginals, + const NCollection_DynamicArray& theReplacements, + const TCollection_AsciiString& theExtraInfo = TCollection_AsciiString()); //! Walk backwards from a modified node to its original. //! Follows the reverse map recursively until a root is reached. @@ -69,7 +69,7 @@ public: //! Follows the forward map recursively, collecting all leaves. //! @param[in] theOriginal node id to trace forward //! @return all transitively derived node ids - [[nodiscard]] Standard_EXPORT NCollection_Vector FindDerived( + [[nodiscard]] Standard_EXPORT NCollection_DynamicArray FindDerived( const BRepGraph_NodeId theOriginal) const; //! Number of recorded history events. @@ -101,13 +101,14 @@ public: private: occ::handle myAllocator; - NCollection_Vector myRecords; + NCollection_DynamicArray myRecords; //! Reverse map: derived node -> original node. NCollection_DataMap myDerivedToOriginal; //! Forward map: original node -> vector of derived nodes. - NCollection_DataMap> myOriginalToDerived; + NCollection_DataMap> + myOriginalToDerived; bool myEnabled = true; }; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_HistoryRecord.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_HistoryRecord.hxx index 6d909784f8..3724eab98b 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_HistoryRecord.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_HistoryRecord.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include //! One atomic modification event recorded in the graph's history log. //! @@ -39,7 +39,7 @@ struct BRepGraph_HistoryRecord //! Key: original node id before the operation. //! Value: sequence of replacement node ids after the operation. - NCollection_DataMap> Mapping; + NCollection_DataMap> Mapping; //! Optional extra info for diagnostic/debugging purposes. //! E.g., merge tolerance, canonical source index. diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Iterator.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Iterator.hxx index 8186c6f2dc..c356dd90ee 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Iterator.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Iterator.hxx @@ -326,8 +326,8 @@ public: NCollection_ForwardRangeSentinel end() const { return NCollection_ForwardRangeSentinel{}; } private: - const NCollection_Vector& myRoots; - int myIndex = 0; + const NCollection_DynamicArray& myRoots; + int myIndex = 0; }; #endif // _BRepGraph_Iterator_HeaderFile diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.cxx index d2f57b4694..a26704fc8b 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.cxx @@ -29,7 +29,7 @@ void BRepGraph_Layer::OnNodeModified(const BRepGraph_NodeId /*theNode*/) noexcep //================================================================================================= void BRepGraph_Layer::OnNodesModified( - const NCollection_Vector& /*theModifiedNodes*/) noexcept + const NCollection_DynamicArray& /*theModifiedNodes*/) noexcept { } @@ -50,7 +50,8 @@ void BRepGraph_Layer::OnRefModified(const BRepGraph_RefId /*theRef*/) noexcept { //================================================================================================= -void BRepGraph_Layer::OnRefsModified(const NCollection_Vector& /*theModifiedRefs*/, - const int /*theModifiedRefKindsMask*/) noexcept +void BRepGraph_Layer::OnRefsModified( + const NCollection_DynamicArray& /*theModifiedRefs*/, + const int /*theModifiedRefKindsMask*/) noexcept { } diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.hxx index a63dbc608a..e5db1c5aa1 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Layer.hxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -117,7 +117,7 @@ public: //! Default: no-op. //! @param[in] theModifiedNodes all modified, non-removed nodes Standard_EXPORT virtual void OnNodesModified( - const NCollection_Vector& theModifiedNodes) noexcept; + const NCollection_DynamicArray& theModifiedNodes) noexcept; //! Convenience: return bitmask bit for a given Kind. static int KindBit(const BRepGraph_NodeId::Kind theKind) @@ -154,8 +154,8 @@ public: //! @param[in] theModifiedRefs all modified, non-removed refs //! @param[in] theModifiedRefKindsMask bitwise OR of all modified ref kinds Standard_EXPORT virtual void OnRefsModified( - const NCollection_Vector& theModifiedRefs, - const int theModifiedRefKindsMask) noexcept; + const NCollection_DynamicArray& theModifiedRefs, + const int theModifiedRefKindsMask) noexcept; //! Convenience: return bitmask bit for a given RefId::Kind. static int RefKindBit(const BRepGraph_RefId::Kind theKind) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.cxx index d70f92a648..cd720a9c4f 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.cxx @@ -21,19 +21,19 @@ namespace static const TCollection_AsciiString THE_LAYER_NAME("Param"); template -void appendUnique(NCollection_DataMap>& theMap, - const KeyT theKey, - const BRepGraph_VertexId theVertex) +void appendUnique(NCollection_DataMap>& theMap, + const KeyT theKey, + const BRepGraph_VertexId theVertex) { if (!theMap.IsBound(theKey)) { - NCollection_Vector aVertices; + NCollection_DynamicArray aVertices; aVertices.Append(theVertex); theMap.Bind(theKey, aVertices); return; } - NCollection_Vector& aVertices = theMap.ChangeFind(theKey); + NCollection_DynamicArray& aVertices = theMap.ChangeFind(theKey); for (const BRepGraph_VertexId& aVtx : aVertices) { if (aVtx == theVertex) @@ -43,16 +43,16 @@ void appendUnique(NCollection_DataMap -void removeVertex(NCollection_DataMap>& theMap, - const KeyT theKey, +void removeVertex(NCollection_DataMap>& theMap, + const KeyT theKey, const BRepGraph_VertexId theVertex) noexcept { if (!theMap.IsBound(theKey)) return; - NCollection_Vector& aVertices = theMap.ChangeFind(theKey); - uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aVertices); anIt.More(); + NCollection_DynamicArray& aVertices = theMap.ChangeFind(theKey); + uint32_t anIdx = 0; + for (NCollection_DynamicArray::Iterator anIt(aVertices); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() != theVertex) @@ -299,7 +299,8 @@ void BRepGraph_LayerParam::SetPointOnCurve(const BRepGraph_VertexId theVertex, const double theParameter) { VertexParams& aParams = changeVertexParams(theVertex); - for (NCollection_Vector::Iterator anIt(aParams.PointsOnCurve); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnCurve); + anIt.More(); anIt.Next()) { if (anIt.Value().EdgeDefId != theEdge) @@ -322,7 +323,8 @@ void BRepGraph_LayerParam::SetPointOnSurface(const BRepGraph_VertexId theVertex, const double theParameterV) { VertexParams& aParams = changeVertexParams(theVertex); - for (NCollection_Vector::Iterator anIt(aParams.PointsOnSurface); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnSurface); + anIt.More(); anIt.Next()) { if (anIt.Value().FaceDefId != theFace) @@ -346,7 +348,8 @@ void BRepGraph_LayerParam::SetPointOnPCurve(const BRepGraph_VertexId theVertex, const double theParameter) { VertexParams& aParams = changeVertexParams(theVertex); - for (NCollection_Vector::Iterator anIt(aParams.PointsOnPCurve); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnPCurve); + anIt.More(); anIt.Next()) { if (anIt.Value().CoEdgeDefId != theCoEdge) @@ -371,7 +374,8 @@ void BRepGraph_LayerParam::removePointOnCurve(const BRepGraph_VertexId theVertex VertexParams& aParams = myVertexParams.ChangeFind(theVertex); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aParams.PointsOnCurve); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnCurve); + anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value().EdgeDefId != theEdge) @@ -398,7 +402,8 @@ void BRepGraph_LayerParam::removePointOnSurface(const BRepGraph_VertexId theVert VertexParams& aParams = myVertexParams.ChangeFind(theVertex); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aParams.PointsOnSurface); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnSurface); + anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value().FaceDefId != theFace) @@ -425,7 +430,8 @@ void BRepGraph_LayerParam::removePointOnPCurve(const BRepGraph_VertexId theVerte VertexParams& aParams = myVertexParams.ChangeFind(theVertex); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aParams.PointsOnPCurve); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aParams.PointsOnPCurve); + anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value().CoEdgeDefId != theCoEdge) @@ -463,11 +469,11 @@ void BRepGraph_LayerParam::removeVertexBindings(const BRepGraph_VertexId theVert void BRepGraph_LayerParam::invalidateEdgeBindings(const BRepGraph_EdgeId theEdge) noexcept { - const NCollection_Vector* aVertices = myEdgeToVertices.Seek(theEdge); + const NCollection_DynamicArray* aVertices = myEdgeToVertices.Seek(theEdge); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) removePointOnCurve(aVtx, theEdge); } @@ -476,11 +482,11 @@ void BRepGraph_LayerParam::invalidateEdgeBindings(const BRepGraph_EdgeId theEdge void BRepGraph_LayerParam::invalidateFaceBindings(const BRepGraph_FaceId theFace) noexcept { - const NCollection_Vector* aVertices = myFaceToVertices.Seek(theFace); + const NCollection_DynamicArray* aVertices = myFaceToVertices.Seek(theFace); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) removePointOnSurface(aVtx, theFace); } @@ -489,11 +495,12 @@ void BRepGraph_LayerParam::invalidateFaceBindings(const BRepGraph_FaceId theFace void BRepGraph_LayerParam::invalidateCoEdgeBindings(const BRepGraph_CoEdgeId theCoEdge) noexcept { - const NCollection_Vector* aVertices = myCoEdgeToVertices.Seek(theCoEdge); + const NCollection_DynamicArray* aVertices = + myCoEdgeToVertices.Seek(theCoEdge); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) removePointOnPCurve(aVtx, theCoEdge); } @@ -529,11 +536,11 @@ void BRepGraph_LayerParam::migrateVertexBindings(const BRepGraph_VertexId theOld void BRepGraph_LayerParam::migrateEdgeBindings(const BRepGraph_EdgeId theOldEdge, const BRepGraph_EdgeId theNewEdge) noexcept { - const NCollection_Vector* aVertices = myEdgeToVertices.Seek(theOldEdge); + const NCollection_DynamicArray* aVertices = myEdgeToVertices.Seek(theOldEdge); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) { double aParameter = 0.0; @@ -549,11 +556,11 @@ void BRepGraph_LayerParam::migrateEdgeBindings(const BRepGraph_EdgeId theOldEdge void BRepGraph_LayerParam::migrateFaceBindings(const BRepGraph_FaceId theOldFace, const BRepGraph_FaceId theNewFace) noexcept { - const NCollection_Vector* aVertices = myFaceToVertices.Seek(theOldFace); + const NCollection_DynamicArray* aVertices = myFaceToVertices.Seek(theOldFace); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) { gp_Pnt2d aUV; @@ -569,11 +576,12 @@ void BRepGraph_LayerParam::migrateFaceBindings(const BRepGraph_FaceId theOldFace void BRepGraph_LayerParam::migrateCoEdgeBindings(const BRepGraph_CoEdgeId theOldCoEdge, const BRepGraph_CoEdgeId theNewCoEdge) noexcept { - const NCollection_Vector* aVertices = myCoEdgeToVertices.Seek(theOldCoEdge); + const NCollection_DynamicArray* aVertices = + myCoEdgeToVertices.Seek(theOldCoEdge); if (aVertices == nullptr) return; - const NCollection_Vector aBoundVertices = *aVertices; + const NCollection_DynamicArray aBoundVertices = *aVertices; for (const BRepGraph_VertexId& aVtx : aBoundVertices) { double aParameter = 0.0; @@ -610,7 +618,7 @@ void BRepGraph_LayerParam::OnNodeModified(const BRepGraph_NodeId theNode) noexce //================================================================================================= void BRepGraph_LayerParam::OnNodesModified( - const NCollection_Vector& theModifiedNodes) noexcept + const NCollection_DynamicArray& theModifiedNodes) noexcept { for (const BRepGraph_NodeId& aModifiedNode : theModifiedNodes) OnNodeModified(aModifiedNode); @@ -661,10 +669,11 @@ void BRepGraph_LayerParam::OnNodeRemoved(const BRepGraph_NodeId theNode, void BRepGraph_LayerParam::OnCompact( const NCollection_DataMap& theRemapMap) noexcept { - NCollection_DataMap aNewParams; - NCollection_DataMap> aNewEdgeToVtx; - NCollection_DataMap> aNewFaceToVtx; - NCollection_DataMap> aNewCoEdgeToVtx; + NCollection_DataMap aNewParams; + NCollection_DataMap> aNewEdgeToVtx; + NCollection_DataMap> aNewFaceToVtx; + NCollection_DataMap> + aNewCoEdgeToVtx; for (const auto& [aOldVertex, aOldParams] : myVertexParams.Items()) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.hxx index 91bc2be047..9a11b5bbbf 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerParam.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include //! @brief Stores vertex-on-curve, vertex-on-surface, and vertex-on-PCurve bindings. @@ -51,9 +51,9 @@ public: struct VertexParams { - NCollection_Vector PointsOnCurve; - NCollection_Vector PointsOnSurface; - NCollection_Vector PointsOnPCurve; + NCollection_DynamicArray PointsOnCurve; + NCollection_DynamicArray PointsOnSurface; + NCollection_DynamicArray PointsOnPCurve; [[nodiscard]] bool IsEmpty() const { @@ -98,7 +98,7 @@ public: [[nodiscard]] Standard_EXPORT int SubscribedKinds() const override; Standard_EXPORT void OnNodeModified(const BRepGraph_NodeId theNode) noexcept override; Standard_EXPORT void OnNodesModified( - const NCollection_Vector& theModifiedNodes) noexcept override; + const NCollection_DynamicArray& theModifiedNodes) noexcept override; Standard_EXPORT void OnNodeRemoved(const BRepGraph_NodeId theNode, const BRepGraph_NodeId theReplacement) noexcept override; Standard_EXPORT void OnCompact( @@ -140,10 +140,12 @@ private: const BRepGraph_CoEdgeId theCoEdge) noexcept; private: - NCollection_DataMap myVertexParams; - NCollection_DataMap> myEdgeToVertices; - NCollection_DataMap> myFaceToVertices; - NCollection_DataMap> + NCollection_DataMap myVertexParams; + NCollection_DataMap> + myEdgeToVertices; + NCollection_DataMap> + myFaceToVertices; + NCollection_DataMap> myCoEdgeToVertices; }; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.cxx index 172cb889c7..8793cd8345 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.cxx @@ -140,8 +140,8 @@ void BRepGraph_LayerRegistry::DispatchNodeModified(const BRepGraph_NodeId theNod //================================================================================================= void BRepGraph_LayerRegistry::DispatchNodesModified( - const NCollection_Vector& theModifiedNodes, - const int theModifiedKindsMask) noexcept + const NCollection_DynamicArray& theModifiedNodes, + const int theModifiedKindsMask) noexcept { if (!HasModificationSubscribers() || theModifiedKindsMask == 0) return; @@ -212,8 +212,8 @@ void BRepGraph_LayerRegistry::DispatchRefModified(const BRepGraph_RefId theRef) //================================================================================================= void BRepGraph_LayerRegistry::DispatchRefsModified( - const NCollection_Vector& theModifiedRefs, - const int theModifiedRefKindsMask) noexcept + const NCollection_DynamicArray& theModifiedRefs, + const int theModifiedRefKindsMask) noexcept { if (!HasRefModificationSubscribers() || theModifiedRefKindsMask == 0) return; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.hxx index 9a155f60e7..8b02b2a849 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegistry.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -87,8 +87,8 @@ public: //! Dispatch OnNodesModified to subscribed layers. Standard_EXPORT void DispatchNodesModified( - const NCollection_Vector& theModifiedNodes, - const int theModifiedKindsMask) noexcept; + const NCollection_DynamicArray& theModifiedNodes, + const int theModifiedKindsMask) noexcept; //! Dispatch OnCompact to all registered layers. Standard_EXPORT void DispatchOnCompact( @@ -110,8 +110,8 @@ public: //! Dispatch OnRefsModified to subscribed layers (deferred/batch mode). Standard_EXPORT void DispatchRefsModified( - const NCollection_Vector& theModifiedRefs, - const int theModifiedRefKindsMask) noexcept; + const NCollection_DynamicArray& theModifiedRefs, + const int theModifiedRefKindsMask) noexcept; //! Clear all registered layer payloads without unregistering them. Standard_EXPORT void ClearAll() noexcept; @@ -123,11 +123,11 @@ private: Standard_EXPORT void recomputeSubscribedKindsMask(); private: - NCollection_Vector> myLayers; - NCollection_DataMap myGuidToSlot; - uint32_t mySubscribedKindsMask = 0; - uint32_t mySubscribedRefKindsMask = 0; - BRepGraph* myOwningGraph = nullptr; + NCollection_DynamicArray> myLayers; + NCollection_DataMap myGuidToSlot; + uint32_t mySubscribedKindsMask = 0; + uint32_t mySubscribedRefKindsMask = 0; + BRepGraph* myOwningGraph = nullptr; }; #endif // _BRepGraph_LayerRegistry_HeaderFile diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.cxx index d6fc1d77bf..d996daa555 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.cxx @@ -23,19 +23,19 @@ namespace static const TCollection_AsciiString THE_LAYER_NAME("Regularity"); void appendUnique( - NCollection_DataMap>& theMap, - const BRepGraph_FaceId theFace, - const BRepGraph_EdgeId theEdge) + NCollection_DataMap>& theMap, + const BRepGraph_FaceId theFace, + const BRepGraph_EdgeId theEdge) { if (!theMap.IsBound(theFace)) { - NCollection_Vector anEdges; + NCollection_DynamicArray anEdges; anEdges.Append(theEdge); theMap.Bind(theFace, anEdges); return; } - NCollection_Vector& anEdges = theMap.ChangeFind(theFace); + NCollection_DynamicArray& anEdges = theMap.ChangeFind(theFace); for (const BRepGraph_EdgeId& aEdge : anEdges) { if (aEdge == theEdge) @@ -44,16 +44,17 @@ void appendUnique( anEdges.Append(theEdge); } -void removeEdge(NCollection_DataMap>& theMap, - const BRepGraph_FaceId theFace, - const BRepGraph_EdgeId theEdge) noexcept +void removeEdge( + NCollection_DataMap>& theMap, + const BRepGraph_FaceId theFace, + const BRepGraph_EdgeId theEdge) noexcept { if (!theMap.IsBound(theFace)) return; - NCollection_Vector& anEdges = theMap.ChangeFind(theFace); - uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(anEdges); anIt.More(); + NCollection_DynamicArray& anEdges = theMap.ChangeFind(theFace); + uint32_t anIdx = 0; + for (NCollection_DynamicArray::Iterator anIt(anEdges); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() != theEdge) @@ -225,7 +226,7 @@ void BRepGraph_LayerRegularity::SetRegularity(const BRepGraph_EdgeId theEdge, normalizeFacePair(aFace1, aFace2); EdgeRegularities& aRegularities = changeEdgeRegularities(theEdge); - for (NCollection_Vector::Iterator anIt(aRegularities.Entries); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aRegularities.Entries); anIt.More(); anIt.Next()) { if (anIt.Value().FaceEntity1 != aFace1 || anIt.Value().FaceEntity2 != aFace2) @@ -258,7 +259,7 @@ void BRepGraph_LayerRegularity::removeRegularity(const BRepGraph_EdgeId theEdge, EdgeRegularities& aRegularities = myEdgeRegularities.ChangeFind(theEdge); bool aFound = false; uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aRegularities.Entries); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aRegularities.Entries); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value().FaceEntity1 != aFace1 || anIt.Value().FaceEntity2 != aFace2) @@ -313,11 +314,11 @@ void BRepGraph_LayerRegularity::removeEdgeBindings(const BRepGraph_EdgeId theEdg void BRepGraph_LayerRegularity::invalidateFaceBindings(const BRepGraph_FaceId theFace) noexcept { - const NCollection_Vector* anEdges = myFaceToEdges.Seek(theFace); + const NCollection_DynamicArray* anEdges = myFaceToEdges.Seek(theFace); if (anEdges == nullptr) return; - const NCollection_Vector aBoundEdges = *anEdges; + const NCollection_DynamicArray aBoundEdges = *anEdges; for (const BRepGraph_EdgeId& aEdgeId : aBoundEdges) { const EdgeRegularities* aRegularities = myEdgeRegularities.Seek(aEdgeId); @@ -354,11 +355,11 @@ void BRepGraph_LayerRegularity::migrateEdgeBindings(const BRepGraph_EdgeId theOl void BRepGraph_LayerRegularity::migrateFaceBindings(const BRepGraph_FaceId theOldFace, const BRepGraph_FaceId theNewFace) noexcept { - const NCollection_Vector* anEdges = myFaceToEdges.Seek(theOldFace); + const NCollection_DynamicArray* anEdges = myFaceToEdges.Seek(theOldFace); if (anEdges == nullptr) return; - const NCollection_Vector aBoundEdges = *anEdges; + const NCollection_DynamicArray aBoundEdges = *anEdges; for (const BRepGraph_EdgeId& aEdgeId : aBoundEdges) { const EdgeRegularities* aRegularities = myEdgeRegularities.Seek(aEdgeId); @@ -399,7 +400,7 @@ void BRepGraph_LayerRegularity::OnNodeModified(const BRepGraph_NodeId theNode) n //================================================================================================= void BRepGraph_LayerRegularity::OnNodesModified( - const NCollection_Vector& theModifiedNodes) noexcept + const NCollection_DynamicArray& theModifiedNodes) noexcept { for (const BRepGraph_NodeId& aModifiedNode : theModifiedNodes) OnNodeModified(aModifiedNode); @@ -434,8 +435,8 @@ void BRepGraph_LayerRegularity::OnNodeRemoved(const BRepGraph_NodeId theNode, void BRepGraph_LayerRegularity::OnCompact( const NCollection_DataMap& theRemapMap) noexcept { - NCollection_DataMap aNewEdgeRegs; - NCollection_DataMap> aNewFaceToEdges; + NCollection_DataMap aNewEdgeRegs; + NCollection_DataMap> aNewFaceToEdges; for (const auto& [aOldEdge, aOldRegularities] : myEdgeRegularities.Items()) { @@ -457,7 +458,8 @@ void BRepGraph_LayerRegularity::OnCompact( // Deduplicate: if same face pair already exists for this edge, update continuity. bool aDuplicate = false; - for (NCollection_Vector::Iterator anIt(aRegularities.Entries); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aRegularities.Entries); + anIt.More(); anIt.Next()) { if (anIt.Value().FaceEntity1 == aNewFace1 && anIt.Value().FaceEntity2 == aNewFace2) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.hxx index 19249d3978..fa8a9ba1cb 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerRegularity.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include //! @brief Stores edge continuity records between adjacent face pairs. class BRepGraph_LayerRegularity : public BRepGraph_Layer @@ -39,7 +39,7 @@ public: struct EdgeRegularities { - NCollection_Vector Entries; + NCollection_DynamicArray Entries; [[nodiscard]] bool IsEmpty() const { return Entries.IsEmpty(); } }; @@ -66,7 +66,7 @@ public: [[nodiscard]] Standard_EXPORT int SubscribedKinds() const override; Standard_EXPORT void OnNodeModified(const BRepGraph_NodeId theNode) noexcept override; Standard_EXPORT void OnNodesModified( - const NCollection_Vector& theModifiedNodes) noexcept override; + const NCollection_DynamicArray& theModifiedNodes) noexcept override; Standard_EXPORT void OnNodeRemoved(const BRepGraph_NodeId theNode, const BRepGraph_NodeId theReplacement) noexcept override; Standard_EXPORT void OnCompact( @@ -92,8 +92,8 @@ private: const BRepGraph_FaceId theNewFace) noexcept; private: - NCollection_DataMap myEdgeRegularities; - NCollection_DataMap> myFaceToEdges; + NCollection_DataMap myEdgeRegularities; + NCollection_DataMap> myFaceToEdges; }; #endif // _BRepGraph_LayerRegularity_HeaderFile diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.cxx index 122049a057..a1089e2b2b 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.cxx @@ -16,7 +16,8 @@ //================================================================================================= template -void BRepGraph_MeshCacheStorage::ensureSize(NCollection_Vector& theVec, const size_t theIndex) +void BRepGraph_MeshCacheStorage::ensureSize(NCollection_DynamicArray& theVec, + const size_t theIndex) { while (theVec.Size() <= theIndex) { @@ -166,7 +167,7 @@ void BRepGraph_MeshCacheStorage::OnCompact( { // Remap face mesh entries. { - NCollection_Vector aNewFaces; + NCollection_DynamicArray aNewFaces; for (NCollection_DataMap::Iterator anIter(theNodeRemapMap); anIter.More(); anIter.Next()) @@ -190,7 +191,7 @@ void BRepGraph_MeshCacheStorage::OnCompact( // Remap coedge mesh entries. { - NCollection_Vector aNewCoEdges; + NCollection_DynamicArray aNewCoEdges; for (NCollection_DataMap::Iterator anIter(theNodeRemapMap); anIter.More(); anIter.Next()) @@ -214,7 +215,7 @@ void BRepGraph_MeshCacheStorage::OnCompact( // Remap edge mesh entries. { - NCollection_Vector aNewEdges; + NCollection_DynamicArray aNewEdges; for (NCollection_DataMap::Iterator anIter(theNodeRemapMap); anIter.More(); anIter.Next()) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.hxx index 8d59440430..95f8c21316 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_MeshCache.hxx @@ -18,7 +18,7 @@ #include #include -#include +#include //! @brief Cached mesh data storage for BRepGraph. //! @@ -55,8 +55,8 @@ namespace BRepGraph_MeshCache //! Cached mesh entry for a face: triangulation rep references. struct FaceMeshEntry { - NCollection_Vector TriangulationRepIds; - int ActiveTriangulationIndex = -1; + NCollection_DynamicArray TriangulationRepIds; + int ActiveTriangulationIndex = -1; uint32_t StoredOwnGen = 0; //!< OwnGen of FaceDef at write time //! True if this entry contains mesh data. @@ -82,8 +82,8 @@ struct FaceMeshEntry //! Cached mesh entry for a coedge: polygon-on-triangulation and polygon-2D rep references. struct CoEdgeMeshEntry { - BRepGraph_Polygon2DRepId Polygon2DRepId; - NCollection_Vector PolygonOnTriRepIds; + BRepGraph_Polygon2DRepId Polygon2DRepId; + NCollection_DynamicArray PolygonOnTriRepIds; uint32_t StoredOwnGen = 0; //!< OwnGen of CoEdgeDef at write time //! True if this entry contains mesh data. @@ -178,11 +178,11 @@ public: private: //! Ensure vector has at least theIndex+1 elements. template - static void ensureSize(NCollection_Vector& theVec, const size_t theIndex); + static void ensureSize(NCollection_DynamicArray& theVec, const size_t theIndex); - NCollection_Vector myFaceMeshes; - NCollection_Vector myCoEdgeMeshes; - NCollection_Vector myEdgeMeshes; + NCollection_DynamicArray myFaceMeshes; + NCollection_DynamicArray myCoEdgeMeshes; + NCollection_DynamicArray myEdgeMeshes; }; #endif // _BRepGraph_MeshCache_HeaderFile diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ParentExplorer.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ParentExplorer.cxx index 89088a930e..8e7640fdb9 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ParentExplorer.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ParentExplorer.cxx @@ -786,8 +786,8 @@ bool BRepGraph_ParentExplorer::nextParentFrame(StackFrame& theChild, StackFrame& } case Kind::Product: { - const BRepGraph_ProductId aProductId(theChild.Node); - const NCollection_Vector& anOccurrences = + const BRepGraph_ProductId aProductId(theChild.Node); + const NCollection_DynamicArray& anOccurrences = aTopo.Products().Instances(aProductId); const uint32_t aNbOccurrences = static_cast(anOccurrences.Size()); if (aParentIdx >= aNbOccurrences) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.cxx index 8cc24af9c8..579b6f0a6d 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.cxx @@ -33,7 +33,7 @@ BRepGraph_RefTransientCache::CacheSlot& BRepGraph_RefTransientCache::changeSlot( const int aRefKindIdx = static_cast(theRef.RefKind); Standard_ASSERT_VOID(aRefKindIdx >= 0 && aRefKindIdx < THE_REF_KIND_COUNT, "BRepGraph_RefTransientCache: RefKind out of range"); - NCollection_Vector& aVec = + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myRefKinds[aRefKindIdx].mySlots; if (theRef.Index >= aVec.Size()) { @@ -56,7 +56,7 @@ const BRepGraph_RefTransientCache::CacheSlot* BRepGraph_RefTransientCache::seekS const int aRefKindIdx = static_cast(theRef.RefKind); Standard_ASSERT_VOID(aRefKindIdx >= 0 && aRefKindIdx < THE_REF_KIND_COUNT, "BRepGraph_RefTransientCache: RefKind out of range"); - const NCollection_Vector& aVec = + const NCollection_DynamicArray& aVec = myKinds.Value(theKindSlot).myRefKinds[aRefKindIdx].mySlots; if (!theRef.IsValidIn(aVec)) { @@ -129,8 +129,8 @@ void BRepGraph_RefTransientCache::Set(const BRepGraph_RefId t if (myIsReserved.load(std::memory_order_acquire) && theKindSlot < myKinds.Length()) { - const int aRefKindIdx = static_cast(theRef.RefKind); - NCollection_Vector& aVec = + const int aRefKindIdx = static_cast(theRef.RefKind); + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myRefKinds[aRefKindIdx].mySlots; if (theRef.Index < aVec.Size()) { @@ -182,8 +182,8 @@ occ::handle BRepGraph_RefTransientCache::Get( if (myIsReserved.load(std::memory_order_acquire) && theKindSlot < myKinds.Length()) { - const int aRefKindIdx = static_cast(theRef.RefKind); - const NCollection_Vector& aVec = + const int aRefKindIdx = static_cast(theRef.RefKind); + const NCollection_DynamicArray& aVec = myKinds.Value(theKindSlot).myRefKinds[aRefKindIdx].mySlots; if (theRef.Index < aVec.Size()) { @@ -247,8 +247,8 @@ bool BRepGraph_RefTransientCache::Remove(const BRepGraph_RefId theRef, const int return false; } - const int aRefKindIdx = static_cast(theRef.RefKind); - NCollection_Vector& aVec = + const int aRefKindIdx = static_cast(theRef.RefKind); + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myRefKinds[aRefKindIdx].mySlots; if (theRef.Index >= aVec.Size()) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.hxx index 9d4743deaa..a1112284d6 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefTransientCache.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -146,7 +146,7 @@ private: //! Per-ref-kind dense vector of cache slots. struct RefKindStore { - NCollection_Vector mySlots; + NCollection_DynamicArray mySlots; }; //! Per-cache-kind storage: one ref-kind store per reference kind. @@ -165,7 +165,7 @@ private: const CacheSlot* seekSlot(const BRepGraph_RefId theRef, const int theKindSlot) const; //! Outer vector indexed by cache-kind slot. - NCollection_Vector myKinds; + NCollection_DynamicArray myKinds; //! True after Reserve() - enables lock-free access for in-range slots. std::atomic myIsReserved{false}; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsIterator.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsIterator.hxx index 992e8f055e..e259343ab5 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsIterator.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsIterator.hxx @@ -229,8 +229,8 @@ struct ShellOfSolidTraits && !theGraph.Topo().Solids().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Solids().Definition(theParent).ShellRefIds; } @@ -255,8 +255,8 @@ struct FaceOfShellTraits && !theGraph.Topo().Shells().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Shells().Definition(theParent).FaceRefIds; } @@ -281,8 +281,8 @@ struct ChildOfShellTraits && !theGraph.Topo().Shells().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Shells().Definition(theParent).AuxChildRefIds; } @@ -307,8 +307,8 @@ struct WireOfFaceTraits && !theGraph.Topo().Faces().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Faces().Definition(theParent).WireRefIds; } @@ -333,8 +333,8 @@ struct VertexOfFaceTraits && !theGraph.Topo().Faces().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Faces().Definition(theParent).VertexRefIds; } @@ -359,8 +359,8 @@ struct CoEdgeOfWireTraits && !theGraph.Topo().Wires().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Wires().Definition(theParent).CoEdgeRefIds; } @@ -385,8 +385,8 @@ struct SolidOfCompSolidTraits && !theGraph.Topo().CompSolids().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().CompSolids().Definition(theParent).SolidRefIds; } @@ -411,8 +411,8 @@ struct ChildOfSolidTraits && !theGraph.Topo().Solids().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Solids().Definition(theParent).AuxChildRefIds; } @@ -437,8 +437,8 @@ struct ChildOfCompoundTraits && !theGraph.Topo().Compounds().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Compounds().Definition(theParent).ChildRefIds; } @@ -463,8 +463,8 @@ struct OccurrenceOfProductTraits && !theGraph.Topo().Products().Definition(theParent).IsRemoved; } - static const NCollection_Vector& RefIds(const BRepGraph& theGraph, - const ParentId theParent) + static const NCollection_DynamicArray& RefIds(const BRepGraph& theGraph, + const ParentId theParent) { return theGraph.Topo().Products().Definition(theParent).OccurrenceRefIds; } @@ -542,10 +542,10 @@ private: } } - const BRepGraph& myGraph; - const NCollection_Vector* myRefIds = nullptr; - uint32_t myIndex = 0; - uint32_t myLength = 0; + const BRepGraph& myGraph; + const NCollection_DynamicArray* myRefIds = nullptr; + uint32_t myIndex = 0; + uint32_t myLength = 0; }; //! @brief Direct active vertex reference ids of an edge. diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.cxx index 6c3172fe59..0d12b777c7 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.cxx @@ -195,10 +195,10 @@ const BRepGraphInc::OccurrenceRef& BRepGraph::RefsView::OccurrenceOps::Entry( //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::FaceOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::FaceOps::IdsOf( const BRepGraph_ShellId theShell) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theShell.IsValid(myGraph->myData->myIncStorage.NbShells())) return anEmpty; return myGraph->myData->myIncStorage.Shell(theShell).FaceRefIds; @@ -206,10 +206,10 @@ const NCollection_Vector& BRepGraph::RefsView::FaceOps::Ids //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::WireOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::WireOps::IdsOf( const BRepGraph_FaceId theFace) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theFace.IsValid(myGraph->myData->myIncStorage.NbFaces())) return anEmpty; return myGraph->myData->myIncStorage.Face(theFace).WireRefIds; @@ -217,10 +217,10 @@ const NCollection_Vector& BRepGraph::RefsView::WireOps::Ids //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::CoEdgeOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::CoEdgeOps::IdsOf( const BRepGraph_WireId theWire) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theWire.IsValid(myGraph->myData->myIncStorage.NbWires())) return anEmpty; return myGraph->myData->myIncStorage.Wire(theWire).CoEdgeRefIds; @@ -228,10 +228,10 @@ const NCollection_Vector& BRepGraph::RefsView::CoEdgeOps: //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::ShellOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::ShellOps::IdsOf( const BRepGraph_SolidId theSolid) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theSolid.IsValid(myGraph->myData->myIncStorage.NbSolids())) return anEmpty; return myGraph->myData->myIncStorage.Solid(theSolid).ShellRefIds; @@ -239,10 +239,10 @@ const NCollection_Vector& BRepGraph::RefsView::ShellOps::I //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::ChildOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::ChildOps::IdsOf( const BRepGraph_CompoundId theCompound) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theCompound.IsValid(myGraph->myData->myIncStorage.NbCompounds())) return anEmpty; return myGraph->myData->myIncStorage.Compound(theCompound).ChildRefIds; @@ -250,10 +250,10 @@ const NCollection_Vector& BRepGraph::RefsView::ChildOps::I //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::OccurrenceOps::IdsOf( - const BRepGraph_ProductId theProduct) const +const NCollection_DynamicArray& BRepGraph::RefsView::OccurrenceOps:: + IdsOf(const BRepGraph_ProductId theProduct) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theProduct.IsValid(myGraph->myData->myIncStorage.NbProducts())) return anEmpty; return myGraph->myData->myIncStorage.Product(theProduct).OccurrenceRefIds; @@ -487,10 +487,10 @@ TopAbs_Orientation BRepGraph::RefsView::Orientation(const BRepGraph_RefId theRef //================================================================================================= -const NCollection_Vector& BRepGraph::RefsView::SolidOps::IdsOf( +const NCollection_DynamicArray& BRepGraph::RefsView::SolidOps::IdsOf( const BRepGraph_CompSolidId theCompSolid) const { - static const NCollection_Vector anEmpty; + static const NCollection_DynamicArray anEmpty; if (!theCompSolid.IsValid(myGraph->myData->myIncStorage.NbCompSolids())) return anEmpty; return myGraph->myData->myIncStorage.CompSolid(theCompSolid).SolidRefIds; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.hxx index 29f218974d..dc9d323e3b 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RefsView.hxx @@ -81,7 +81,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::ShellRef& Entry( const BRepGraph_ShellRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_SolidId theSolid) const; private: @@ -108,7 +108,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::FaceRef& Entry( const BRepGraph_FaceRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_ShellId theShell) const; private: @@ -135,7 +135,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::WireRef& Entry( const BRepGraph_WireRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_FaceId theFace) const; private: @@ -162,7 +162,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::CoEdgeRef& Entry( const BRepGraph_CoEdgeRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_WireId theWire) const; private: @@ -214,7 +214,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::SolidRef& Entry( const BRepGraph_SolidRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_CompSolidId theCompSolid) const; private: @@ -241,7 +241,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::ChildRef& Entry( const BRepGraph_ChildRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_CompoundId theCompound) const; private: @@ -274,7 +274,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::OccurrenceRef& Entry( const BRepGraph_OccurrenceRefId theRefId) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& IdsOf( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& IdsOf( const BRepGraph_ProductId theProduct) const; private: diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RelatedIterator.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RelatedIterator.hxx index bd0439fb2a..d3528fde29 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RelatedIterator.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_RelatedIterator.hxx @@ -186,7 +186,7 @@ private: continue; } - const NCollection_Vector& aFaces = + const NCollection_DynamicArray& aFaces = myGraph->Topo().Edges().Faces(aCoEdgeIt.Current().EdgeDefId); for (; myDeepIndex < static_cast(aFaces.Size()); ++myDeepIndex) { @@ -222,8 +222,8 @@ private: //! Advance through a reverse-index iterator (e.g. BRepGraph_FacesOfEdge). //! Constructs a ParentsOf starting at myIndex for O(1) amortized resumption. template - [[nodiscard]] bool advanceParents(const NCollection_Vector& theParents, - const RelationKind theRelation) + [[nodiscard]] bool advanceParents(const NCollection_DynamicArray& theParents, + const RelationKind theRelation) { BRepGraph_ReverseIterator::ParentsOf anIt(*myGraph, theParents, myIndex); if (anIt.More()) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ReverseIterator.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ReverseIterator.hxx index 6095435ebd..6374107bd4 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ReverseIterator.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_ReverseIterator.hxx @@ -23,7 +23,7 @@ //! @brief Single-level typed iterators over parent definitions via reverse index. //! -//! These iterators wrap the NCollection_Vector returned by TopoView +//! These iterators wrap the NCollection_DynamicArray returned by TopoView //! reverse-index accessors (e.g. Edges().Faces(), Wires().Faces(), Vertices().Edges()). //! They provide a typed, skip-removed iteration pattern consistent with the //! forward iterators in BRepGraph_DefsIterator and BRepGraph_RefsIterator. @@ -181,7 +181,7 @@ template class ParentsOf { public: - ParentsOf(const BRepGraph& theGraph, const NCollection_Vector& theParents) + ParentsOf(const BRepGraph& theGraph, const NCollection_DynamicArray& theParents) : myGraph(&theGraph), myParents(&theParents) { @@ -190,9 +190,9 @@ public: //! Construct starting at a given vector index (for resumable iteration). //! Skips to the first non-removed entry at or after theStartIndex. - ParentsOf(const BRepGraph& theGraph, - const NCollection_Vector& theParents, - const uint32_t theStartIndex) + ParentsOf(const BRepGraph& theGraph, + const NCollection_DynamicArray& theParents, + const uint32_t theStartIndex) : myGraph(&theGraph), myParents(&theParents), myIndex(theStartIndex) @@ -256,9 +256,9 @@ private: } } - const BRepGraph* myGraph = nullptr; - const NCollection_Vector* myParents = nullptr; - uint32_t myIndex = 0; + const BRepGraph* myGraph = nullptr; + const NCollection_DynamicArray* myParents = nullptr; + uint32_t myIndex = 0; }; //! Result pair returned by RefsParentsOf: parent definition ID + the RefId @@ -284,9 +284,9 @@ public: using RefIdType = typename TraitsT::RefId; using ResultType = ParentRef; - RefsParentsOf(const BRepGraph& theGraph, - const NCollection_Vector& theParents, - const ChildIdType theChild) + RefsParentsOf(const BRepGraph& theGraph, + const NCollection_DynamicArray& theParents, + const ChildIdType theChild) : myGraph(&theGraph), myParents(&theParents), myChild(theChild) @@ -342,12 +342,12 @@ private: } } - const BRepGraph* myGraph = nullptr; - const NCollection_Vector* myParents = nullptr; - ChildIdType myChild; - ResultType myCurrent; - uint32_t myIndex = 0; - bool myHasCurrent = false; + const BRepGraph* myGraph = nullptr; + const NCollection_DynamicArray* myParents = nullptr; + ChildIdType myChild; + ResultType myCurrent; + uint32_t myIndex = 0; + bool myHasCurrent = false; }; // Traits for RefsParentsOf - each knows how to find the RefId diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Tool.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Tool.cxx index 162cc8d7b1..370b5830ca 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Tool.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Tool.cxx @@ -800,7 +800,7 @@ uint32_t BRepGraph_Tool::Wire::NbCoEdges(const BRepGraph& theGraph, const BRepGr BRepGraph_FaceId BRepGraph_Tool::Wire::FaceOf(const BRepGraph& theGraph, const BRepGraph_WireId theWire) { - const NCollection_Vector& aFaces = theGraph.Topo().Wires().Faces(theWire); + const NCollection_DynamicArray& aFaces = theGraph.Topo().Wires().Faces(theWire); if (aFaces.IsEmpty()) return BRepGraph_FaceId(); return aFaces.First(); @@ -810,7 +810,7 @@ BRepGraph_FaceId BRepGraph_Tool::Wire::FaceOf(const BRepGraph& theGraph, bool BRepGraph_Tool::Wire::IsOuter(const BRepGraph& theGraph, const BRepGraph_WireId theWire) { - const NCollection_Vector& aFaces = theGraph.Topo().Wires().Faces(theWire); + const NCollection_DynamicArray& aFaces = theGraph.Topo().Wires().Faces(theWire); for (const BRepGraph_FaceId& aFaceId : aFaces) { if (!aFaceId.IsValid()) diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.cxx index 5c68508362..d6360df764 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.cxx @@ -37,12 +37,13 @@ constexpr int THE_TOPOVIEW_SAME_DOMAIN_BLOCK_SIZE = 8; constexpr int THE_TOPOVIEW_SHARED_EDGE_BLOCK_SIZE = 4; //! Collect unique edge IDs reachable from a face through its wire/coedge refs. -NCollection_Vector collectFaceEdges( +NCollection_DynamicArray collectFaceEdges( const BRepGraph& theGraph, const BRepGraph_FaceId theFace, const occ::handle& theAllocator) { - NCollection_Vector aResult(THE_TOPOVIEW_FACE_EDGE_BLOCK_SIZE, theAllocator); + NCollection_DynamicArray aResult(THE_TOPOVIEW_FACE_EDGE_BLOCK_SIZE, + theAllocator); if (!theFace.IsValid(theGraph.Topo().Faces().Nb())) return aResult; @@ -65,9 +66,9 @@ NCollection_Vector collectFaceEdges( //================================================================================================= template -const NCollection_Vector& emptyVector() +const NCollection_DynamicArray& emptyVector() { - static const NCollection_Vector THE_EMPTY_VECTOR; + static const NCollection_DynamicArray THE_EMPTY_VECTOR; return THE_EMPTY_VECTOR; } @@ -101,7 +102,7 @@ const BRepGraphInc::FaceDef& BRepGraph::TopoView::FaceOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::FaceOps::Shells( +const NCollection_DynamicArray& BRepGraph::TopoView::FaceOps::Shells( const BRepGraph_FaceId theFace) const { return myGraph->myData->myIncStorage.ReverseIndex().ShellsOfFaceRef(theFace); @@ -109,10 +110,10 @@ const NCollection_Vector& BRepGraph::TopoView::FaceOps::Shell //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::FaceOps::Compounds( +const NCollection_DynamicArray& BRepGraph::TopoView::FaceOps::Compounds( const BRepGraph_FaceId theFace) const { - const NCollection_Vector* aCompounds = + const NCollection_DynamicArray* aCompounds = myGraph->myData->myIncStorage.ReverseIndex().CompoundsOfFace(theFace); return aCompounds != nullptr ? *aCompounds : emptyVector(); } @@ -157,12 +158,13 @@ BRepGraph_TriangulationRepId BRepGraph::TopoView::FaceOps::ActiveTriangulationRe //================================================================================================= -NCollection_Vector BRepGraph::TopoView::FaceOps::SameDomain( +NCollection_DynamicArray BRepGraph::TopoView::FaceOps::SameDomain( const BRepGraph_FaceId theFace, const occ::handle& theAllocator) const { - NCollection_Vector aResult(THE_TOPOVIEW_SAME_DOMAIN_BLOCK_SIZE, theAllocator); - const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; + NCollection_DynamicArray aResult(THE_TOPOVIEW_SAME_DOMAIN_BLOCK_SIZE, + theAllocator); + const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; if (!theFace.IsValid(aStorage.NbFaces())) { return aResult; @@ -188,21 +190,22 @@ NCollection_Vector BRepGraph::TopoView::FaceOps::SameDomain( //================================================================================================= -NCollection_Vector BRepGraph::TopoView::FaceOps::SharedEdges( +NCollection_DynamicArray BRepGraph::TopoView::FaceOps::SharedEdges( const BRepGraph_FaceId theFaceA, const BRepGraph_FaceId theFaceB, const occ::handle& theAllocator) const { - NCollection_Vector aResult(THE_TOPOVIEW_SHARED_EDGE_BLOCK_SIZE, theAllocator); - const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; + NCollection_DynamicArray aResult(THE_TOPOVIEW_SHARED_EDGE_BLOCK_SIZE, + theAllocator); + const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; if (!theFaceA.IsValid(aStorage.NbFaces()) || !theFaceB.IsValid(aStorage.NbFaces())) { return aResult; } - const NCollection_Vector aFaceAEdges = + const NCollection_DynamicArray aFaceAEdges = collectFaceEdges(*myGraph, theFaceA, theAllocator); - const NCollection_Vector aFaceBEdges = + const NCollection_DynamicArray aFaceBEdges = collectFaceEdges(*myGraph, theFaceB, theAllocator); NCollection_Map aFaceAEdgeSet; NCollection_Map anAddedEdges; @@ -224,25 +227,25 @@ NCollection_Vector BRepGraph::TopoView::FaceOps::SharedEdges( //================================================================================================= -NCollection_Vector BRepGraph::TopoView::FaceOps::Adjacent( +NCollection_DynamicArray BRepGraph::TopoView::FaceOps::Adjacent( const BRepGraph_FaceId theFace, const occ::handle& theAllocator) const { - NCollection_Vector aResult(THE_TOPOVIEW_FACE_ADJACENCY_BLOCK_SIZE, - theAllocator); - NCollection_Map aFaceSet; - const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; + NCollection_DynamicArray aResult(THE_TOPOVIEW_FACE_ADJACENCY_BLOCK_SIZE, + theAllocator); + NCollection_Map aFaceSet; + const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; if (!theFace.IsValid(aStorage.NbFaces())) { return aResult; } - const NCollection_Vector anEdges = + const NCollection_DynamicArray anEdges = collectFaceEdges(*myGraph, theFace, theAllocator); const BRepGraphInc_ReverseIndex& aRevIdx = aStorage.ReverseIndex(); for (const BRepGraph_EdgeId& anEdgeId : anEdges) { - const NCollection_Vector* aFaces = aRevIdx.FacesOfEdge(anEdgeId); + const NCollection_DynamicArray* aFaces = aRevIdx.FacesOfEdge(anEdgeId); if (aFaces == nullptr) { continue; @@ -322,7 +325,7 @@ uint32_t BRepGraph::TopoView::EdgeOps::NbFaces(const BRepGraph_EdgeId theEdge) c //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::EdgeOps::Wires( +const NCollection_DynamicArray& BRepGraph::TopoView::EdgeOps::Wires( const BRepGraph_EdgeId theEdge) const { return myGraph->myData->myIncStorage.ReverseIndex().WiresOfEdgeRef(theEdge); @@ -330,7 +333,7 @@ const NCollection_Vector& BRepGraph::TopoView::EdgeOps::Wires( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::EdgeOps::CoEdges( +const NCollection_DynamicArray& BRepGraph::TopoView::EdgeOps::CoEdges( const BRepGraph_EdgeId theEdge) const { return myGraph->myData->myIncStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdge); @@ -338,7 +341,7 @@ const NCollection_Vector& BRepGraph::TopoView::EdgeOps::CoEd //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::EdgeOps::Faces( +const NCollection_DynamicArray& BRepGraph::TopoView::EdgeOps::Faces( const BRepGraph_EdgeId theEdge) const { return myGraph->myData->myIncStorage.ReverseIndex().FacesOfEdgeRef(theEdge); @@ -365,21 +368,21 @@ BRepGraph_Curve3DRepId BRepGraph::TopoView::EdgeOps::Curve3DRepId( //================================================================================================= -NCollection_Vector BRepGraph::TopoView::EdgeOps::Adjacent( +NCollection_DynamicArray BRepGraph::TopoView::EdgeOps::Adjacent( const BRepGraph_EdgeId theEdge, const occ::handle& theAllocator) const { - NCollection_Vector aResult(THE_TOPOVIEW_EDGE_ADJACENCY_BLOCK_SIZE, - theAllocator); - const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; + NCollection_DynamicArray aResult(THE_TOPOVIEW_EDGE_ADJACENCY_BLOCK_SIZE, + theAllocator); + const BRepGraphInc_Storage& aStorage = myGraph->myData->myIncStorage; if (!theEdge.IsValid(aStorage.NbEdges())) { return aResult; } - NCollection_Vector aVertices(THE_TOPOVIEW_EDGE_VERTEX_BLOCK_SIZE, - theAllocator); - NCollection_Map aSeenVertices; + NCollection_DynamicArray aVertices(THE_TOPOVIEW_EDGE_VERTEX_BLOCK_SIZE, + theAllocator); + NCollection_Map aSeenVertices; for (BRepGraph_DefsVertexOfEdge aVertexIt(*myGraph, theEdge); aVertexIt.More(); aVertexIt.Next()) { const BRepGraph_VertexId aVertexId = aVertexIt.CurrentId(); @@ -394,7 +397,7 @@ NCollection_Vector BRepGraph::TopoView::EdgeOps::Adjacent( NCollection_Map anEdgeSet; for (const BRepGraph_VertexId& aVertexId : aVertices) { - const NCollection_Vector* anEdges = aRevIdx.EdgesOfVertex(aVertexId); + const NCollection_DynamicArray* anEdges = aRevIdx.EdgesOfVertex(aVertexId); if (anEdges == nullptr) { continue; @@ -448,7 +451,7 @@ const BRepGraphInc::CoEdgeDef* BRepGraph::TopoView::EdgeOps::FindPCurve( return nullptr; } - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdge); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { @@ -474,7 +477,7 @@ const BRepGraphInc::CoEdgeDef* BRepGraph::TopoView::EdgeOps::FindPCurve( return nullptr; } - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdge); const BRepGraphInc::CoEdgeDef* aFirstMatch = nullptr; for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) @@ -507,7 +510,7 @@ BRepGraph_CoEdgeId BRepGraph::TopoView::EdgeOps::FindCoEdgeId(const BRepGraph_Ed return BRepGraph_CoEdgeId(); } - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdge); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { @@ -533,7 +536,7 @@ BRepGraph_CoEdgeId BRepGraph::TopoView::EdgeOps::FindCoEdgeId( return BRepGraph_CoEdgeId(); } - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aStorage.ReverseIndex().CoEdgesOfEdgeRef(theEdge); BRepGraph_CoEdgeId aFirstMatch; for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) @@ -579,7 +582,7 @@ const BRepGraphInc::VertexDef& BRepGraph::TopoView::VertexOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::VertexOps::Edges( +const NCollection_DynamicArray& BRepGraph::TopoView::VertexOps::Edges( const BRepGraph_VertexId theVertex) const { return myGraph->myData->myIncStorage.ReverseIndex().EdgesOfVertexRef(theVertex); @@ -609,7 +612,7 @@ const BRepGraphInc::WireDef& BRepGraph::TopoView::WireOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::WireOps::Faces( +const NCollection_DynamicArray& BRepGraph::TopoView::WireOps::Faces( const BRepGraph_WireId theWire) const { return myGraph->myData->myIncStorage.ReverseIndex().FacesOfWireRef(theWire); @@ -639,7 +642,7 @@ const BRepGraphInc::ShellDef& BRepGraph::TopoView::ShellOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::ShellOps::Solids( +const NCollection_DynamicArray& BRepGraph::TopoView::ShellOps::Solids( const BRepGraph_ShellId theShell) const { return myGraph->myData->myIncStorage.ReverseIndex().SolidsOfShellRef(theShell); @@ -647,10 +650,10 @@ const NCollection_Vector& BRepGraph::TopoView::ShellOps::Soli //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::ShellOps::Compounds( +const NCollection_DynamicArray& BRepGraph::TopoView::ShellOps::Compounds( const BRepGraph_ShellId theShell) const { - const NCollection_Vector* aCompounds = + const NCollection_DynamicArray* aCompounds = myGraph->myData->myIncStorage.ReverseIndex().CompoundsOfShell(theShell); return aCompounds != nullptr ? *aCompounds : emptyVector(); } @@ -679,20 +682,20 @@ const BRepGraphInc::SolidDef& BRepGraph::TopoView::SolidOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::SolidOps::CompSolids( +const NCollection_DynamicArray& BRepGraph::TopoView::SolidOps::CompSolids( const BRepGraph_SolidId theSolid) const { - const NCollection_Vector* aCompSolids = + const NCollection_DynamicArray* aCompSolids = myGraph->myData->myIncStorage.ReverseIndex().CompSolidsOfSolid(theSolid); return aCompSolids != nullptr ? *aCompSolids : emptyVector(); } //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::SolidOps::Compounds( +const NCollection_DynamicArray& BRepGraph::TopoView::SolidOps::Compounds( const BRepGraph_SolidId theSolid) const { - const NCollection_Vector* aCompounds = + const NCollection_DynamicArray* aCompounds = myGraph->myData->myIncStorage.ReverseIndex().CompoundsOfSolid(theSolid); return aCompounds != nullptr ? *aCompounds : emptyVector(); } @@ -721,10 +724,10 @@ const BRepGraphInc::CoEdgeDef& BRepGraph::TopoView::CoEdgeOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::CoEdgeOps::Wires( +const NCollection_DynamicArray& BRepGraph::TopoView::CoEdgeOps::Wires( const BRepGraph_CoEdgeId theCoEdge) const { - const NCollection_Vector* aWires = + const NCollection_DynamicArray* aWires = myGraph->myData->myIncStorage.ReverseIndex().WiresOfCoEdge(theCoEdge); return aWires != nullptr ? *aWires : emptyVector(); } @@ -839,10 +842,10 @@ const BRepGraphInc::CompoundDef& BRepGraph::TopoView::CompoundOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::CompoundOps::ParentCompounds( - const BRepGraph_CompoundId theCompound) const +const NCollection_DynamicArray& BRepGraph::TopoView::CompoundOps:: + ParentCompounds(const BRepGraph_CompoundId theCompound) const { - const NCollection_Vector* aCompounds = + const NCollection_DynamicArray* aCompounds = myGraph->myData->myIncStorage.ReverseIndex().CompoundsOfCompound(theCompound); return aCompounds != nullptr ? *aCompounds : emptyVector(); } @@ -871,10 +874,10 @@ const BRepGraphInc::CompSolidDef& BRepGraph::TopoView::CompSolidOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::CompSolidOps::Compounds( +const NCollection_DynamicArray& BRepGraph::TopoView::CompSolidOps::Compounds( const BRepGraph_CompSolidId theCompSolid) const { - const NCollection_Vector* aCompounds = + const NCollection_DynamicArray* aCompounds = myGraph->myData->myIncStorage.ReverseIndex().CompoundsOfCompSolid(theCompSolid); return aCompounds != nullptr ? *aCompounds : emptyVector(); } @@ -903,10 +906,10 @@ const BRepGraphInc::ProductDef& BRepGraph::TopoView::ProductOps::Definition( //================================================================================================= -const NCollection_Vector& BRepGraph::TopoView::ProductOps::Instances( +const NCollection_DynamicArray& BRepGraph::TopoView::ProductOps::Instances( const BRepGraph_ProductId theProduct) const { - const NCollection_Vector* anOccurrences = + const NCollection_DynamicArray* anOccurrences = myGraph->myData->myIncStorage.ReverseIndex().OccurrencesOfProduct(theProduct); return anOccurrences != nullptr ? *anOccurrences : emptyVector(); } diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.hxx index 3fd8171ded..7fd1815c08 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TopoView.hxx @@ -63,22 +63,22 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::FaceDef& Definition( const BRepGraph_FaceId theFace) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Shells( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Shells( const BRepGraph_FaceId theFace) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Compounds( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Compounds( const BRepGraph_FaceId theFace) const; [[nodiscard]] Standard_EXPORT BRepGraph_SurfaceRepId SurfaceRepId(const BRepGraph_FaceId theFace) const; [[nodiscard]] Standard_EXPORT BRepGraph_TriangulationRepId ActiveTriangulationRepId(const BRepGraph_FaceId theFace) const; - [[nodiscard]] Standard_EXPORT NCollection_Vector SameDomain( + [[nodiscard]] Standard_EXPORT NCollection_DynamicArray SameDomain( const BRepGraph_FaceId theFace, const occ::handle& theAllocator) const; - [[nodiscard]] Standard_EXPORT NCollection_Vector SharedEdges( + [[nodiscard]] Standard_EXPORT NCollection_DynamicArray SharedEdges( const BRepGraph_FaceId theFaceA, const BRepGraph_FaceId theFaceB, const occ::handle& theAllocator) const; - [[nodiscard]] Standard_EXPORT NCollection_Vector Adjacent( + [[nodiscard]] Standard_EXPORT NCollection_DynamicArray Adjacent( const BRepGraph_FaceId theFace, const occ::handle& theAllocator) const; [[nodiscard]] Standard_EXPORT BRepGraph_WireId OuterWire(const BRepGraph_FaceId theFace) const; @@ -108,15 +108,15 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::EdgeDef& Definition( const BRepGraph_EdgeId theEdge) const; [[nodiscard]] Standard_EXPORT uint32_t NbFaces(const BRepGraph_EdgeId theEdge) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Wires( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Wires( const BRepGraph_EdgeId theEdge) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& CoEdges( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& CoEdges( const BRepGraph_EdgeId theEdge) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Faces( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Faces( const BRepGraph_EdgeId theEdge) const; [[nodiscard]] Standard_EXPORT BRepGraph_Curve3DRepId Curve3DRepId(const BRepGraph_EdgeId theEdge) const; - [[nodiscard]] Standard_EXPORT NCollection_Vector Adjacent( + [[nodiscard]] Standard_EXPORT NCollection_DynamicArray Adjacent( const BRepGraph_EdgeId theEdge, const occ::handle& theAllocator) const; [[nodiscard]] Standard_EXPORT bool IsBoundary(const BRepGraph_EdgeId theEdge) const; @@ -171,7 +171,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::VertexDef& Definition( const BRepGraph_VertexId theVertex) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Edges( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Edges( const BRepGraph_VertexId theVertex) const; private: @@ -198,7 +198,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::WireDef& Definition( const BRepGraph_WireId theWire) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Faces( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Faces( const BRepGraph_WireId theWire) const; private: @@ -225,9 +225,9 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::ShellDef& Definition( const BRepGraph_ShellId theShell) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Solids( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Solids( const BRepGraph_ShellId theShell) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Compounds( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Compounds( const BRepGraph_ShellId theShell) const; private: @@ -254,9 +254,9 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::SolidDef& Definition( const BRepGraph_SolidId theSolid) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& CompSolids( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& CompSolids( const BRepGraph_SolidId theSolid) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Compounds( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Compounds( const BRepGraph_SolidId theSolid) const; private: @@ -283,7 +283,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::CoEdgeDef& Definition( const BRepGraph_CoEdgeId theCoEdge) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Wires( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Wires( const BRepGraph_CoEdgeId theCoEdge) const; [[nodiscard]] Standard_EXPORT BRepGraph_EdgeId Edge(const BRepGraph_CoEdgeId theCoEdge) const; [[nodiscard]] Standard_EXPORT BRepGraph_FaceId Face(const BRepGraph_CoEdgeId theCoEdge) const; @@ -316,8 +316,8 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompoundDef& Definition( const BRepGraph_CompoundId theCompound) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& ParentCompounds( - const BRepGraph_CompoundId theCompound) const; + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& + ParentCompounds(const BRepGraph_CompoundId theCompound) const; private: friend class TopoView; @@ -343,7 +343,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::CompSolidDef& Definition( const BRepGraph_CompSolidId theCompSolid) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Compounds( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Compounds( const BRepGraph_CompSolidId theCompSolid) const; private: @@ -370,7 +370,7 @@ public: [[nodiscard]] Standard_EXPORT const BRepGraphInc::ProductDef& Definition( const BRepGraph_ProductId theProduct) const; - [[nodiscard]] Standard_EXPORT const NCollection_Vector& Instances( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& Instances( const BRepGraph_ProductId theProduct) const; [[nodiscard]] Standard_EXPORT BRepGraph_NodeId ShapeRoot(const BRepGraph_ProductId theProduct) const; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.cxx index 228270ad96..749cb752e0 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.cxx @@ -14,7 +14,7 @@ #include #include -#include +#include IMPLEMENT_STANDARD_RTTIEXT(BRepGraph_CacheKind, Standard_Transient) @@ -23,9 +23,9 @@ namespace struct BRepGraph_CacheKindRegistryData { - NCollection_DataMap GuidToSlot; - NCollection_Vector> Kinds; - std::shared_mutex Mutex; + NCollection_DataMap GuidToSlot; + NCollection_DynamicArray> Kinds; + std::shared_mutex Mutex; }; BRepGraph_CacheKindRegistryData& cacheKindRegistryData() @@ -163,7 +163,7 @@ BRepGraph_TransientCache::CacheSlot& BRepGraph_TransientCache::changeSlot( const int aKindIdx = static_cast(theNode.NodeKind); Standard_ASSERT_VOID(aKindIdx >= 0 && aKindIdx < THE_KIND_COUNT, "BRepGraph_TransientCache: NodeKind out of range"); - NCollection_Vector& aVec = + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myNodeKinds[aKindIdx].mySlots; if (theNode.Index >= aVec.Size()) { @@ -186,7 +186,7 @@ const BRepGraph_TransientCache::CacheSlot* BRepGraph_TransientCache::seekSlot( const int aKindIdx = static_cast(theNode.NodeKind); Standard_ASSERT_VOID(aKindIdx >= 0 && aKindIdx < THE_KIND_COUNT, "BRepGraph_TransientCache: NodeKind out of range"); - const NCollection_Vector& aVec = + const NCollection_DynamicArray& aVec = myKinds.Value(theKindSlot).myNodeKinds[aKindIdx].mySlots; if (!theNode.IsValidIn(aVec)) { @@ -258,8 +258,8 @@ void BRepGraph_TransientCache::Set(const BRepGraph_NodeId theN if (myIsReserved.load(std::memory_order_acquire) && theKindSlot < myKinds.Length()) { - const int aKindIdx = static_cast(theNode.NodeKind); - NCollection_Vector& aVec = + const int aKindIdx = static_cast(theNode.NodeKind); + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myNodeKinds[aKindIdx].mySlots; if (theNode.Index < aVec.Size()) { @@ -311,8 +311,8 @@ occ::handle BRepGraph_TransientCache::Get( if (myIsReserved.load(std::memory_order_acquire) && theKindSlot < myKinds.Length()) { - const int aKindIdx = static_cast(theNode.NodeKind); - const NCollection_Vector& aVec = + const int aKindIdx = static_cast(theNode.NodeKind); + const NCollection_DynamicArray& aVec = myKinds.Value(theKindSlot).myNodeKinds[aKindIdx].mySlots; if (theNode.Index < aVec.Size()) { @@ -376,8 +376,8 @@ bool BRepGraph_TransientCache::Remove(const BRepGraph_NodeId theNode, const int return false; } - const int aKindIdx = static_cast(theNode.NodeKind); - NCollection_Vector& aVec = + const int aKindIdx = static_cast(theNode.NodeKind); + NCollection_DynamicArray& aVec = myKinds.ChangeValue(theKindSlot).myNodeKinds[aKindIdx].mySlots; if (theNode.Index >= aVec.Size()) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.hxx index 065c2eca8e..8345deb0b6 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_TransientCache.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -331,7 +331,7 @@ private: //! Per-node-kind dense vector of cache slots. struct NodeKindStore { - NCollection_Vector mySlots; + NCollection_DynamicArray mySlots; }; //! Per-cache-kind storage: one node-kind store per entity kind. @@ -350,7 +350,7 @@ private: const CacheSlot* seekSlot(const BRepGraph_NodeId theNode, const int theKindSlot) const; //! Outer vector indexed by cache-kind slot. - NCollection_Vector myKinds; + NCollection_DynamicArray myKinds; //! True after Reserve() - enables lock-free access for in-range slots. std::atomic myIsReserved{false}; diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_UIDsView.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_UIDsView.cxx index 27c07fc8c7..9bb39316f9 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_UIDsView.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_UIDsView.cxx @@ -23,7 +23,7 @@ namespace void appendRefUIDReverseIndex(BRepGraph_Data& theData, const BRepGraph_RefId::Kind theKind) { - const NCollection_Vector& aUIDs = theData.myIncStorage.RefUIDs(theKind); + const NCollection_DynamicArray& aUIDs = theData.myIncStorage.RefUIDs(theKind); for (BRepGraph_RefId aRefId = BRepGraph_RefId::Start(theKind); aRefId.IsValidIn(aUIDs); ++aRefId) { const BRepGraph_RefUID aUID = aUIDs.Value(static_cast(aRefId.Index)); @@ -38,7 +38,7 @@ void appendRefUIDReverseIndex(BRepGraph_Data& theData, const BRepGraph_RefId::Ki void appendUIDReverseIndex(BRepGraph_Data& theData, const BRepGraph_NodeId::Kind theKind) { - const NCollection_Vector& aUIDs = theData.myIncStorage.UIDs(theKind); + const NCollection_DynamicArray& aUIDs = theData.myIncStorage.UIDs(theKind); for (BRepGraph_NodeId aNodeId = BRepGraph_NodeId::Start(theKind); aNodeId.IsValidIn(aUIDs); ++aNodeId) { @@ -130,7 +130,7 @@ BRepGraph_UID BRepGraph::UIDsView::Of(const BRepGraph_NodeId theNode) const if (aDef == nullptr || aDef->IsRemoved) return BRepGraph_UID(); - const NCollection_Vector& aVec = + const NCollection_DynamicArray& aVec = myGraph->myData->myIncStorage.UIDs(theNode.NodeKind); if (!theNode.IsValidIn(aVec)) return BRepGraph_UID(); @@ -144,7 +144,7 @@ BRepGraph_RefUID BRepGraph::UIDsView::Of(const BRepGraph_RefId theRefId) const if (!theRefId.IsValid()) return BRepGraph_RefUID(); - const NCollection_Vector& aVec = + const NCollection_DynamicArray& aVec = myGraph->myData->myIncStorage.RefUIDs(theRefId.RefKind); if (!theRefId.IsValidIn(aVec)) return BRepGraph_RefUID(); @@ -239,7 +239,7 @@ BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf(const BRepGraph_NodeId theNo if (!theNode.IsValid()) return BRepGraph_VersionStamp(); - const NCollection_Vector& aVec = + const NCollection_DynamicArray& aVec = myGraph->myData->myIncStorage.UIDs(theNode.NodeKind); if (!theNode.IsValidIn(aVec)) return BRepGraph_VersionStamp(); @@ -259,7 +259,7 @@ BRepGraph_VersionStamp BRepGraph::UIDsView::StampOf(const BRepGraph_RefId theRef if (!theRefId.IsValid()) return BRepGraph_VersionStamp(); - const NCollection_Vector& aUIDs = + const NCollection_DynamicArray& aUIDs = myGraph->myData->myIncStorage.RefUIDs(theRefId.RefKind); if (!theRefId.IsValidIn(aUIDs)) return BRepGraph_VersionStamp(); diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.cxx index 5552ea7ab0..b6310f99f8 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.cxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.cxx @@ -78,8 +78,8 @@ bool isEntityRemoved(const BRepGraph& theGraph, BRepGraph_NodeId theId) //! @param[in] theBoundaryIssues boundary issues reported by mutator //! @param[in,out] theIssues destination validator issue vector void appendMutationBoundaryIssues( - const NCollection_Vector& theBoundaryIssues, - NCollection_Vector& theIssues) + const NCollection_DynamicArray& theBoundaryIssues, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -93,8 +93,8 @@ void appendMutationBoundaryIssues( //! coedge, compound child refs) point to valid, in-bounds entity slots. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkCrossReferenceBounds(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkCrossReferenceBounds(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -338,8 +338,8 @@ void checkCrossReferenceBounds(const BRepGraph& th //! (edge->wires, edge->faces, vertex->edges, wire->faces, face->shells, shell->solids). //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkReverseIndexConsistency(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkReverseIndexConsistency(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -370,7 +370,7 @@ void checkReverseIndexConsistency(const BRepGraph& { const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aActualWires = + const NCollection_DynamicArray& aActualWires = theGraph.Topo().Edges().Wires(anEdgeId); const NCollection_Map* anExpectedWires = anExpected.Seek(anEdgeId); @@ -408,8 +408,8 @@ void checkReverseIndexConsistency(const BRepGraph& //! Validate consistency of cached edge-face counts in reverse index. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkReverseIndexFaceCountCache(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkReverseIndexFaceCountCache(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -420,8 +420,8 @@ void checkReverseIndexFaceCountCache(const BRepGraph& { const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - NCollection_Map aUniqueFaces; - const NCollection_Vector& aCoEdges = aDefs.Edges().CoEdges(anEdgeId); + NCollection_Map aUniqueFaces; + const NCollection_DynamicArray& aCoEdges = aDefs.Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { const BRepGraphInc::CoEdgeDef& aCoEdge = aDefs.CoEdges().Definition(aCoEdgeId); @@ -450,8 +450,8 @@ void checkReverseIndexFaceCountCache(const BRepGraph& //! of the expected kind. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkIncidenceRefConsistency(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkIncidenceRefConsistency(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -513,8 +513,8 @@ void checkIncidenceRefConsistency(const BRepGraph& //! reference non-null geometry handles. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkGeometryReferences(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkGeometryReferences(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -657,8 +657,8 @@ void checkGeometryReferences(const BRepGraph& theG //! parent entity through forward incidence refs. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkRemovedNodeIsolation(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkRemovedNodeIsolation(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -741,8 +741,8 @@ void checkRemovedNodeIsolation(const BRepGraph& th //! order-independent traversal. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkWireConnectivity(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkWireConnectivity(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Issue = BRepGraph_Validate::Issue; using Severity = BRepGraph_Validate::Severity; @@ -824,8 +824,8 @@ void checkWireConnectivity(const BRepGraph& theGra //! entities in each per-kind vector. //! @param[in] theGraph source graph //! @param[in,out] theIssues collection to append diagnostic issues -void checkActiveCounts(const BRepGraph& theGraph, - NCollection_Vector& theIssues) +void checkActiveCounts(const BRepGraph& theGraph, + NCollection_DynamicArray& theIssues) { using Severity = BRepGraph_Validate::Severity; using Issue = BRepGraph_Validate::Issue; @@ -924,7 +924,7 @@ BRepGraph_Validate::Result BRepGraph_Validate::Perform(const BRepGraph& theGraph if (theOptions.ValidationMode == Mode::Lightweight) { - NCollection_Vector aBoundaryIssues; + NCollection_DynamicArray aBoundaryIssues; if (!theGraph.Editor().ValidateMutationBoundary(&aBoundaryIssues)) { appendMutationBoundaryIssues(aBoundaryIssues, aResult.Issues); @@ -932,7 +932,7 @@ BRepGraph_Validate::Result BRepGraph_Validate::Perform(const BRepGraph& theGraph return aResult; } - NCollection_Vector aBoundaryIssues; + NCollection_DynamicArray aBoundaryIssues; if (!theGraph.Editor().ValidateMutationBoundary(&aBoundaryIssues)) { appendMutationBoundaryIssues(aBoundaryIssues, aResult.Issues); @@ -1008,9 +1008,9 @@ BRepGraph_Validate::Result BRepGraph_Validate::Perform(const BRepGraph& theGraph // BFS from this product's children; skip already-visited to avoid // exponential blowup on DAGs. A cycle exists if we re-encounter aProdIdx. - NCollection_Map aVisited; - NCollection_Vector aQueue; - size_t aHead = 0; + NCollection_Map aVisited; + NCollection_DynamicArray aQueue; + size_t aHead = 0; // Seed with direct children. for (BRepGraph_RefsOccurrenceOfProduct anOccIt(theGraph, aProdId); anOccIt.More(); @@ -1078,10 +1078,10 @@ BRepGraph_Validate::Result BRepGraph_Validate::Perform(const BRepGraph& theGraph for (BRepGraph_Iterator aCompIt(theGraph); aCompIt.More(); aCompIt.Next()) { - const BRepGraph_CompoundId aRootCompoundId = aCompIt.CurrentId(); - NCollection_Map aVisited; - NCollection_Vector aQueue; - size_t aHead = 0; + const BRepGraph_CompoundId aRootCompoundId = aCompIt.CurrentId(); + NCollection_Map aVisited; + NCollection_DynamicArray aQueue; + size_t aHead = 0; for (BRepGraph_RefsChildOfCompound anIt(theGraph, aRootCompoundId); anIt.More(); anIt.Next()) { diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.hxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.hxx index 1e531f17f0..d588b668f0 100644 --- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.hxx +++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_Validate.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -89,7 +89,7 @@ public: //! Aggregated validation result. struct Result { - NCollection_Vector Issues; + NCollection_DynamicArray Issues; //! True if no Error-level issues were found. [[nodiscard]] bool IsValid() const diff --git a/src/ModelingData/TKBRep/BRepGraph/README.md b/src/ModelingData/TKBRep/BRepGraph/README.md index c2c8d265d5..b55c3f7183 100644 --- a/src/ModelingData/TKBRep/BRepGraph/README.md +++ b/src/ModelingData/TKBRep/BRepGraph/README.md @@ -349,7 +349,7 @@ Centralized per-node (TransientCache) and per-reference (RefTransientCache) cach - **Purpose**: ephemeral computed caches (bounding boxes, UV bounds, FClass2d results) - **Identity**: cache families are described by `BRepGraph_CacheKind` with stable `Standard_GUID` identity -- **Storage**: dense `NCollection_Vector` per cache kind, then per node kind, then per entity index +- **Storage**: dense `NCollection_DynamicArray` per cache kind, then per node kind, then per entity index - **Granularity**: one cached value per `(node, cache kind)` - **Freshness**: SubtreeGen-validated for nodes (each slot stores `StoredSubtreeGen`); OwnGen-validated for refs (refs have no subtree). On read, if the stored generation differs from the entity's current generation, the attribute is marked dirty and recomputed lazily. - **Thread safety**: `shared_mutex` (concurrent reads from `OSD_Parallel::For`, exclusive writes) diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Definition.hxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Definition.hxx index ae75886edc..42dd7fa888 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Definition.hxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Definition.hxx @@ -25,7 +25,7 @@ #include #include -#include +#include //! @brief Definition structs for the incidence-table topology model. //! @@ -38,11 +38,11 @@ namespace BRepGraphInc //! Helper: reinitialize a vector member with the given allocator and block size. template -inline void InitVec(NCollection_Vector& theVec, +inline void InitVec(NCollection_DynamicArray& theVec, const occ::handle& theAlloc, const int theBlockSize = 4) { - theVec = NCollection_Vector(theBlockSize, theAlloc); + theVec = NCollection_DynamicArray(theBlockSize, theAlloc); } //! Fields shared by every entity. @@ -119,7 +119,7 @@ struct EdgeDef : public BaseDef //! Additional vertex reference ids with INTERNAL or EXTERNAL orientation. //! Edges with only FORWARD/REVERSED boundary vertices leave this empty. - NCollection_Vector InternalVertexRefIds; + NCollection_DynamicArray InternalVertexRefIds; //! Typed representation id into Storage::myPolygons3D (invalid if no polygon). BRepGraph_Polygon3DRepId Polygon3DRepId; @@ -171,8 +171,8 @@ struct WireDef : public BaseDef { using TypeId = BRepGraph_WireId; - bool IsClosed = false; - NCollection_Vector CoEdgeRefIds; //!< Ordered coedge ref indices + bool IsClosed = false; + NCollection_DynamicArray CoEdgeRefIds; //!< Ordered coedge ref indices void InitVectors(const occ::handle& theAlloc) { @@ -192,13 +192,13 @@ struct FaceDef : public BaseDef double Tolerance = 0.0; bool NaturalRestriction = false; - NCollection_Vector WireRefIds; //!< Wire ref indices (outer first) + NCollection_DynamicArray WireRefIds; //!< Wire ref indices (outer first) //! Direct INTERNAL/EXTERNAL vertex children (not inside wires). //! Boundary vertices are normally reached through WireRefIds -> CoEdgeRefIds //! -> CoEdgeDef.EdgeDefId -> EdgeDef.{StartVertexRefId, EndVertexRefId}. //! This vector is for additional direct face-owned vertex usage. - NCollection_Vector VertexRefIds; + NCollection_DynamicArray VertexRefIds; void InitVectors(const occ::handle& theAlloc) { @@ -213,8 +213,9 @@ struct ShellDef : public BaseDef using TypeId = BRepGraph_ShellId; bool IsClosed = false; //!< True if shell forms a watertight (closed) boundary. - NCollection_Vector FaceRefIds; //!< Face ref indices - NCollection_Vector AuxChildRefIds; //!< Non-face children (wires, edges) + NCollection_DynamicArray FaceRefIds; //!< Face ref indices + NCollection_DynamicArray + AuxChildRefIds; //!< Non-face children (wires, edges) void InitVectors(const occ::handle& theAlloc) { @@ -228,8 +229,9 @@ struct SolidDef : public BaseDef { using TypeId = BRepGraph_SolidId; - NCollection_Vector ShellRefIds; //!< Shell ref indices - NCollection_Vector AuxChildRefIds; //!< Non-shell children (edges, vertices) + NCollection_DynamicArray ShellRefIds; //!< Shell ref indices + NCollection_DynamicArray + AuxChildRefIds; //!< Non-shell children (edges, vertices) void InitVectors(const occ::handle& theAlloc) { @@ -243,7 +245,7 @@ struct CompoundDef : public BaseDef { using TypeId = BRepGraph_CompoundId; - NCollection_Vector ChildRefIds; //!< Child ref indices + NCollection_DynamicArray ChildRefIds; //!< Child ref indices void InitVectors(const occ::handle& theAlloc) { @@ -256,7 +258,7 @@ struct CompSolidDef : public BaseDef { using TypeId = BRepGraph_CompSolidId; - NCollection_Vector SolidRefIds; //!< Solid ref indices + NCollection_DynamicArray SolidRefIds; //!< Solid ref indices void InitVectors(const occ::handle& theAlloc) { @@ -273,7 +275,7 @@ struct ProductDef : public BaseDef { using TypeId = BRepGraph_ProductId; - NCollection_Vector + NCollection_DynamicArray OccurrenceRefIds; //!< All children (shape roots and sub-products) void InitVectors(const occ::handle& theAlloc) diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.cxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.cxx index 7458723c7a..7be1a0b21e 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.cxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.cxx @@ -197,39 +197,39 @@ struct ExtractedInternalVertex //! Per-edge data extracted from TopoDS in parallel phase. struct ExtractedEdge { - TopoDS_Edge Shape; - occ::handle Curve3d; - double ParamFirst = 0.0; - double ParamLast = 0.0; - double Tolerance = 0.0; - bool IsDegenerate = false; - bool SameParameter = false; - bool SameRange = false; - ExtractedVertex StartVertex; - ExtractedVertex EndVertex; - NCollection_Vector InternalVertices; - TopAbs_Orientation OrientationInWire = TopAbs_FORWARD; - occ::handle PCurve2d; - double PCFirst = 0.0; - double PCLast = 0.0; - occ::handle PCurve2dReversed; - double PCFirstReversed = 0.0; - double PCLastReversed = 0.0; - GeomAbs_Shape PCurveContinuity = GeomAbs_C0; - gp_Pnt2d PCUV1; - gp_Pnt2d PCUV2; - GeomAbs_Shape SeamContinuity = GeomAbs_C0; - occ::handle Polygon3D; - occ::handle PolyOnSurf; - occ::handle PolyOnSurfReversed; + TopoDS_Edge Shape; + occ::handle Curve3d; + double ParamFirst = 0.0; + double ParamLast = 0.0; + double Tolerance = 0.0; + bool IsDegenerate = false; + bool SameParameter = false; + bool SameRange = false; + ExtractedVertex StartVertex; + ExtractedVertex EndVertex; + NCollection_DynamicArray InternalVertices; + TopAbs_Orientation OrientationInWire = TopAbs_FORWARD; + occ::handle PCurve2d; + double PCFirst = 0.0; + double PCLast = 0.0; + occ::handle PCurve2dReversed; + double PCFirstReversed = 0.0; + double PCLastReversed = 0.0; + GeomAbs_Shape PCurveContinuity = GeomAbs_C0; + gp_Pnt2d PCUV1; + gp_Pnt2d PCUV2; + GeomAbs_Shape SeamContinuity = GeomAbs_C0; + occ::handle Polygon3D; + occ::handle PolyOnSurf; + occ::handle PolyOnSurfReversed; }; //! Per-wire data extracted in parallel phase. struct ExtractedWire { - TopoDS_Wire Shape; - bool IsOuter = false; - NCollection_Vector Edges; + TopoDS_Wire Shape; + bool IsOuter = false; + NCollection_DynamicArray Edges; }; //! All data extracted from a single face. @@ -241,14 +241,15 @@ struct FaceLocalData BRepGraph_ShellId ParentShellId; // Phase 2 extracted geometry. - occ::handle Surface; - occ::handle OriginalSurface; //!< Pre-transform surface for PCurve matching - occ::handle ActiveTriangulation; - double Tolerance = 0.0; - TopAbs_Orientation Orientation = TopAbs_FORWARD; - bool NaturalRestriction = false; - NCollection_Vector Wires; - NCollection_Vector DirectVertices; //!< INTERNAL/EXTERNAL vertex children + occ::handle Surface; + occ::handle OriginalSurface; //!< Pre-transform surface for PCurve matching + occ::handle ActiveTriangulation; + double Tolerance = 0.0; + TopAbs_Orientation Orientation = TopAbs_FORWARD; + bool NaturalRestriction = false; + NCollection_DynamicArray Wires; + NCollection_DynamicArray + DirectVertices; //!< INTERNAL/EXTERNAL vertex children }; //! Extract stored PCurve(s) from edge for a given face's surface. @@ -777,10 +778,10 @@ bool makeAuxChildRef(const BRepGraphInc_Storage& theStorage, //! vertex of each orientation becomes the boundary vertex; earlier ones are demoted //! to the internal list with their original orientation preserved. INTERNAL and //! EXTERNAL vertices go directly to the internal list. -static void edgeVertices(const TopoDS_Edge& theEdge, - TopoDS_Vertex& theFirst, - TopoDS_Vertex& theLast, - NCollection_Vector& theInternal) +static void edgeVertices(const TopoDS_Edge& theEdge, + TopoDS_Vertex& theFirst, + TopoDS_Vertex& theLast, + NCollection_DynamicArray& theInternal) { for (TopoDS_Iterator aVIt(theEdge, false, false); aVIt.More(); aVIt.Next()) { @@ -1041,9 +1042,9 @@ void extractFaceData(FaceLocalData& theData) //! Register pre-extracted face data into incidence storage. //! Uses unified TShapeToNodeId map and populates OriginalShapes. -void registerFaceData(BRepGraphInc_Storage& theStorage, - const NCollection_Vector& theFaceData, - RepDedup& theRepDedup) +void registerFaceData(BRepGraphInc_Storage& theStorage, + const NCollection_DynamicArray& theFaceData, + RepDedup& theRepDedup) { for (const FaceLocalData& aData : theFaceData) { @@ -1294,11 +1295,11 @@ void registerFaceData(BRepGraphInc_Storage& theStorage, //! Recursively traverse a TopoDS hierarchy, registering container entities //! (Compound, CompSolid, Solid, Shell) and collecting face contexts into theFaceData. //! Used by Perform() for Phase 1. -void traverseHierarchy(BRepGraphInc_Storage& theStorage, - NCollection_Vector& theFaceData, - RepDedup& theRepDedup, - const TopoDS_Shape& theCurrentShape, - const TopLoc_Location& theParentGlobalLoc) +void traverseHierarchy(BRepGraphInc_Storage& theStorage, + NCollection_DynamicArray& theFaceData, + RepDedup& theRepDedup, + const TopoDS_Shape& theCurrentShape, + const TopLoc_Location& theParentGlobalLoc) { if (theCurrentShape.IsNull()) return; @@ -1532,8 +1533,8 @@ void traverseHierarchy(BRepGraphInc_Storage& theStorage, } // Extract vertices. - TopoDS_Vertex aVFirst, aVLast; - NCollection_Vector anInternalVerts; + TopoDS_Vertex aVFirst, aVLast; + NCollection_DynamicArray anInternalVerts; edgeVertices(anEdge, aVFirst, aVLast, anInternalVerts); // Register vertices (using definition-frame points; Location stored on VertexRef). @@ -1599,8 +1600,8 @@ void traverseHierarchy(BRepGraphInc_Storage& theStorage, } //! Append a root NodeId to the vector, skipping duplicates. -static void appendUniqueRootNode(NCollection_Vector& theRoots, - const BRepGraph_NodeId& theNodeId) +static void appendUniqueRootNode(NCollection_DynamicArray& theRoots, + const BRepGraph_NodeId& theNodeId) { if (!theNodeId.IsValid()) return; @@ -1616,12 +1617,12 @@ static void appendUniqueRootNode(NCollection_Vector& theRoots, //! Flatten hierarchy containers away for AppendFlattened(). //! Face roots are collected for the parallel face pipeline; standalone //! wire/edge/vertex roots are registered directly through traverseHierarchy(). -void flattenForAppend(BRepGraphInc_Storage& theStorage, - NCollection_Vector& theFaceData, - RepDedup& theRepDedup, - const TopoDS_Shape& theCurrentShape, - const TopLoc_Location& theParentGlobalLoc, - NCollection_Vector* theAppendedRoots) +void flattenForAppend(BRepGraphInc_Storage& theStorage, + NCollection_DynamicArray& theFaceData, + RepDedup& theRepDedup, + const TopoDS_Shape& theCurrentShape, + const TopLoc_Location& theParentGlobalLoc, + NCollection_DynamicArray* theAppendedRoots) { if (theCurrentShape.IsNull()) return; @@ -1774,7 +1775,7 @@ void populateParamLayer(BRepGraphInc_Storage& theStorage } NCollection_DataMap aSurfToFaceDef(1, theTmpAlloc); - NCollection_Vector aFaceRawSurfaces(1, theTmpAlloc); + NCollection_DynamicArray aFaceRawSurfaces(1, theTmpAlloc); const uint32_t aNbFaces = theStorage.NbFaces(); for (BRepGraph_FaceId aFaceId = BRepGraph_FaceId::Start(); aFaceId.IsValid(aNbFaces); ++aFaceId) { @@ -1793,9 +1794,8 @@ void populateParamLayer(BRepGraphInc_Storage& theStorage aFaceRawSurfaces.Append(aRawSurfPtr); } - NCollection_DataMap> aPCurveToCoEdges( - 1, - theTmpAlloc); + NCollection_DataMap> + aPCurveToCoEdges(1, theTmpAlloc); const uint32_t aNbCoEdges = theStorage.NbCoEdges(); for (BRepGraph_CoEdgeId aCoEdgeId(0); aCoEdgeId.IsValid(aNbCoEdges); ++aCoEdgeId) { @@ -1807,10 +1807,11 @@ void populateParamLayer(BRepGraphInc_Storage& theStorage if (aPCurve.IsNull()) continue; - NCollection_Vector* aCoEdges = aPCurveToCoEdges.ChangeSeek(aPCurve.get()); + NCollection_DynamicArray* aCoEdges = + aPCurveToCoEdges.ChangeSeek(aPCurve.get()); if (aCoEdges == nullptr) { - NCollection_Vector aNewCoEdges(1, theTmpAlloc); + NCollection_DynamicArray aNewCoEdges(1, theTmpAlloc); aNewCoEdges.Append(aCoEdgeId); aPCurveToCoEdges.Bind(aPCurve.get(), aNewCoEdges); } @@ -1849,7 +1850,7 @@ void populateParamLayer(BRepGraphInc_Storage& theStorage else if (const occ::handle aPOCS = occ::down_cast(aPtRep)) { - const NCollection_Vector* aCandidates = + const NCollection_DynamicArray* aCandidates = aPCurveToCoEdges.Seek(aPOCS->PCurve().get()); if (aCandidates == nullptr) continue; @@ -1933,8 +1934,8 @@ void BRepGraphInc_Populate::Perform(BRepGraphInc_Storage& theStorage, const int aParallelWorkers = theParallel ? BRepGraph_ParallelPolicy::WorkerCount() : 1; // Phase 1 (sequential): Recursively explore hierarchy, collecting face contexts. - NCollection_Vector aFaceData(256, aTmpAlloc); - RepDedup aRepDedup; + NCollection_DynamicArray aFaceData(256, aTmpAlloc); + RepDedup aRepDedup; traverseHierarchy(theStorage, aFaceData, aRepDedup, theShape, TopLoc_Location()); @@ -2019,7 +2020,7 @@ void BRepGraphInc_Populate::AppendFlattened( BRepGraphInc_Storage& theStorage, const TopoDS_Shape& theShape, const bool theParallel, - NCollection_Vector& theAppendedRoots, + NCollection_DynamicArray& theAppendedRoots, const Options& theOptions, BRepGraph_LayerParam* theParamLayer, BRepGraph_LayerRegularity* theRegularityLayer, @@ -2047,8 +2048,8 @@ void BRepGraphInc_Populate::AppendFlattened( const uint32_t anOldNbSolidRefs = theStorage.NbSolidRefs(); // Collect face contexts by flattening hierarchy. - NCollection_Vector aFaceData(256, aTmpAlloc); - RepDedup aRepDedup; + NCollection_DynamicArray aFaceData(256, aTmpAlloc); + RepDedup aRepDedup; flattenForAppend(theStorage, aFaceData, @@ -2134,8 +2135,8 @@ void BRepGraphInc_Populate::Append(BRepGraphInc_Storage& // Phase 1 (sequential): Traverse the full hierarchy. // Existing shapes are deduplicated via findExistingNode; only new shapes are added. - NCollection_Vector aFaceData(256, aTmpAlloc); - RepDedup aRepDedup; + NCollection_DynamicArray aFaceData(256, aTmpAlloc); + RepDedup aRepDedup; traverseHierarchy(theStorage, aFaceData, aRepDedup, theShape, TopLoc_Location()); // Phase 2 (parallel): Per-face geometry extraction. diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.hxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.hxx index 1861ef6da9..d4acea2a1e 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.hxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Populate.hxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include class TopoDS_Shape; @@ -87,7 +87,7 @@ public: BRepGraphInc_Storage& theStorage, const TopoDS_Shape& theShape, const bool theParallel, - NCollection_Vector& theAppendedRoots, + NCollection_DynamicArray& theAppendedRoots, const Options& theOptions = Options(), BRepGraph_LayerParam* theParamLayer = nullptr, BRepGraph_LayerRegularity* theRegularityLayer = nullptr, diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.cxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.cxx index 7a06343f86..0005d5188e 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.cxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.cxx @@ -752,9 +752,9 @@ TopoDS_Shape BRepGraphInc_Reconstruct::FaceWithCache( // Add wires to face: outer first, then inner. // Wire orientation must be applied before adding to face. - TopoDS_Wire anOuterWire; - NCollection_Vector anInnerWires(Cache::THE_DEFAULT_INCREMENT, - theCache.myTempAllocator); + TopoDS_Wire anOuterWire; + NCollection_DynamicArray anInnerWires(Cache::THE_DEFAULT_INCREMENT, + theCache.myTempAllocator); for (const BRepGraph_WireRefId& aWireRefId : aFace.WireRefIds) { const BRepGraphInc::WireRef& aWireRef = theStorage.WireRef(aWireRefId); diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.hxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.hxx index b0361efa77..9fbd374b8f 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.hxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Reconstruct.hxx @@ -19,7 +19,7 @@ #include #include -#include +#include class BRepGraphInc_Storage; class BRepGraph_LayerParam; @@ -46,10 +46,10 @@ public: static constexpr int THE_KIND_COUNT = BRepGraph_NodeId::THE_KIND_COUNT; static constexpr int THE_DEFAULT_INCREMENT = 32; - occ::handle myAllocator; - occ::handle myTempAllocator; - NCollection_Vector myKinds[THE_KIND_COUNT]; - int myTempScopeDepth = 0; + occ::handle myAllocator; + occ::handle myTempAllocator; + NCollection_DynamicArray myKinds[THE_KIND_COUNT]; + int myTempScopeDepth = 0; struct TempScope { @@ -77,7 +77,8 @@ public: { for (int aKindIdx = 0; aKindIdx < THE_KIND_COUNT; ++aKindIdx) { - myKinds[aKindIdx] = NCollection_Vector(THE_DEFAULT_INCREMENT, myAllocator); + myKinds[aKindIdx] = + NCollection_DynamicArray(THE_DEFAULT_INCREMENT, myAllocator); } } @@ -87,7 +88,7 @@ public: const int aKindIdx = static_cast(theNode.NodeKind); if (aKindIdx < 0 || aKindIdx >= THE_KIND_COUNT) return nullptr; - const NCollection_Vector& aVec = myKinds[aKindIdx]; + const NCollection_DynamicArray& aVec = myKinds[aKindIdx]; if (theNode.Index >= aVec.Size()) return nullptr; const TopoDS_Shape& aShape = aVec.Value(static_cast(theNode.Index)); @@ -100,7 +101,7 @@ public: const int aKindIdx = static_cast(theNode.NodeKind); if (aKindIdx < 0 || aKindIdx >= THE_KIND_COUNT) return; - NCollection_Vector& aVec = myKinds[aKindIdx]; + NCollection_DynamicArray& aVec = myKinds[aKindIdx]; aVec.SetValue(static_cast(theNode.Index), theShape); } diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.cxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.cxx index b87ee30e0a..016ce9191a 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.cxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.cxx @@ -26,8 +26,8 @@ namespace template BRepGraph_VertexId resolveVertexDefId( - const NCollection_Vector& theVertexRefs, - const T theRefId) + const NCollection_DynamicArray& theVertexRefs, + const T theRefId) { if (!theRefId.IsValid(static_cast(theVertexRefs.Size()))) return BRepGraph_VertexId(); @@ -35,13 +35,13 @@ BRepGraph_VertexId resolveVertexDefId( } template -bool containsIndexInTable(const NCollection_Vector>& theIdx, - const TKey theKey, - const TVal theVal) +bool containsIndexInTable(const NCollection_DynamicArray>& theIdx, + const TKey theKey, + const TVal theVal) { if (!theKey.IsValid(static_cast(theIdx.Size()))) return false; - const NCollection_Vector& aVec = theIdx.Value(static_cast(theKey.Index)); + const NCollection_DynamicArray& aVec = theIdx.Value(static_cast(theKey.Index)); for (const TVal& anElem : aVec) if (anElem == theVal) return true; @@ -49,10 +49,10 @@ bool containsIndexInTable(const NCollection_Vector>& th } static bool hasActiveFaceForEdgeInCoEdges( - const NCollection_Vector& theCoEdgeIds, - const NCollection_Vector& theCoEdges, - const BRepGraph_EdgeId theEdgeId, - const BRepGraph_FaceId theFaceId) + const NCollection_DynamicArray& theCoEdgeIds, + const NCollection_DynamicArray& theCoEdges, + const BRepGraph_EdgeId theEdgeId, + const BRepGraph_FaceId theFaceId) { for (const BRepGraph_CoEdgeId& aCoEdgeId : theCoEdgeIds) { @@ -126,22 +126,22 @@ void BRepGraphInc_ReverseIndex::Build(const BRepGraphInc_Storage& theStorage) //================================================================================================= void BRepGraphInc_ReverseIndex::Build( - const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs) + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs) { myNbIndexedCoEdges = 0; @@ -247,7 +247,7 @@ void BRepGraphInc_ReverseIndex::Build( { if (theEdges.Value(static_cast(anEdgeId.Index)).IsRemoved) continue; - const NCollection_Vector* aCoEdgeIdxs = + const NCollection_DynamicArray* aCoEdgeIdxs = seekVec(myEdgeToCoEdges, anEdgeId.Index); if (aCoEdgeIdxs == nullptr) continue; @@ -443,31 +443,31 @@ void BRepGraphInc_ReverseIndex::Build( //================================================================================================= void BRepGraphInc_ReverseIndex::BuildDelta( - const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs, - const uint32_t theOldNbEdges, - const uint32_t theOldNbWires, - const uint32_t theOldNbFaces, - const uint32_t theOldNbShells, - const uint32_t theOldNbSolids, - const uint32_t theOldNbCompounds, - const uint32_t theOldNbCompSolids, - const uint32_t theOldNbChildRefs, - const uint32_t theOldNbSolidRefs) + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs, + const uint32_t theOldNbEdges, + const uint32_t theOldNbWires, + const uint32_t theOldNbFaces, + const uint32_t theOldNbShells, + const uint32_t theOldNbSolids, + const uint32_t theOldNbCompounds, + const uint32_t theOldNbCompSolids, + const uint32_t theOldNbChildRefs, + const uint32_t theOldNbSolidRefs) { // Helper: resolve a VertexRefId to the corresponding VertexDefId (BRepGraph_VertexId). @@ -588,7 +588,7 @@ void BRepGraphInc_ReverseIndex::BuildDelta( { if (theEdges.Value(static_cast(anEdgeId.Index)).IsRemoved) continue; - const NCollection_Vector* aCoEdgeIdxs = + const NCollection_DynamicArray* aCoEdgeIdxs = seekVec(myEdgeToCoEdges, anEdgeId.Index); if (aCoEdgeIdxs == nullptr) continue; @@ -862,10 +862,10 @@ void BRepGraphInc_ReverseIndex::UnbindEdgeFromWire(const BRepGraph_EdgeId theEdg { if (theEdgeId.Index >= myEdgeToWires.Size()) return; - NCollection_Vector& aWires = + NCollection_DynamicArray& aWires = myEdgeToWires.ChangeValue(static_cast(theEdgeId.Index)); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aWires); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aWires); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == theWireId) @@ -885,10 +885,10 @@ void BRepGraphInc_ReverseIndex::UnbindCoEdgeFromWire(const BRepGraph_CoEdgeId th { if (theCoEdgeId.Index >= myCoEdgeToWires.Size()) return; - NCollection_Vector& aWires = + NCollection_DynamicArray& aWires = myCoEdgeToWires.ChangeValue(static_cast(theCoEdgeId.Index)); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aWires); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aWires); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == theWireId) @@ -926,10 +926,10 @@ void BRepGraphInc_ReverseIndex::UnbindVertexFromEdge(const BRepGraph_VertexId th { if (theVertexId.Index >= myVertexToEdges.Size()) return; - NCollection_Vector& anEdges = + NCollection_DynamicArray& anEdges = myVertexToEdges.ChangeValue(static_cast(theVertexId.Index)); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(anEdges); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(anEdges); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == theEdgeId) @@ -957,10 +957,10 @@ void BRepGraphInc_ReverseIndex::UnbindEdgeFromCoEdge(const BRepGraph_EdgeId th { if (theEdgeId.Index >= myEdgeToCoEdges.Size()) return; - NCollection_Vector& aCoEdges = + NCollection_DynamicArray& aCoEdges = myEdgeToCoEdges.ChangeValue(static_cast(theEdgeId.Index)); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aCoEdges); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aCoEdges); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == theCoEdgeId) @@ -988,10 +988,10 @@ void BRepGraphInc_ReverseIndex::UnbindEdgeFromFace(const BRepGraph_EdgeId theEdg { if (theEdgeId.Index >= myEdgeToFaces.Size()) return; - NCollection_Vector& aFaces = + NCollection_DynamicArray& aFaces = myEdgeToFaces.ChangeValue(static_cast(theEdgeId.Index)); uint32_t anIdx = 0; - for (NCollection_Vector::Iterator anIt(aFaces); anIt.More(); + for (NCollection_DynamicArray::Iterator anIt(aFaces); anIt.More(); anIt.Next(), ++anIdx) { if (anIt.Value() == theFaceId) @@ -1007,22 +1007,22 @@ void BRepGraphInc_ReverseIndex::UnbindEdgeFromFace(const BRepGraph_EdgeId theEdg //================================================================================================= bool BRepGraphInc_ReverseIndex::Validate( - const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs) const + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs) const { auto hasActiveWireUsageOfEdge = [&](const BRepGraph_WireId theWireId, const BRepGraph_EdgeId theEdgeId) -> bool { @@ -1118,7 +1118,7 @@ bool BRepGraphInc_ReverseIndex::Validate( return false; } - const NCollection_Vector* aCoEdgeIds = + const NCollection_DynamicArray* aCoEdgeIds = seekVec(myEdgeToCoEdges, theEdgeId.Index); if (aCoEdgeIds == nullptr) { @@ -1552,7 +1552,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbEdgeToWires = static_cast(myEdgeToWires.Size()); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdgeToWires); ++anEdgeId) { - const NCollection_Vector& aWires = WiresOfEdgeRef(anEdgeId); + const NCollection_DynamicArray& aWires = WiresOfEdgeRef(anEdgeId); for (const BRepGraph_WireId& aWireId2 : aWires) { if (!aWireId2.IsValid(static_cast(theWires.Size()))) @@ -1569,7 +1569,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbEdgeToCoEdges = static_cast(myEdgeToCoEdges.Size()); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdgeToCoEdges); ++anEdgeId) { - const NCollection_Vector& aCoEdges = CoEdgesOfEdgeRef(anEdgeId); + const NCollection_DynamicArray& aCoEdges = CoEdgesOfEdgeRef(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId2 : aCoEdges) { if (!aCoEdgeId2.IsValid(static_cast(theCoEdges.Size()))) @@ -1588,7 +1588,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbWireToFaces = static_cast(myWireToFaces.Size()); for (BRepGraph_WireId aWireId(0); aWireId.IsValid(aNbWireToFaces); ++aWireId) { - const NCollection_Vector& aFaces = FacesOfWireRef(aWireId); + const NCollection_DynamicArray& aFaces = FacesOfWireRef(aWireId); for (const BRepGraph_FaceId& aFaceId2 : aFaces) { if (!aFaceId2.IsValid(static_cast(theFaces.Size()))) @@ -1605,7 +1605,8 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbEdgeToFaces = static_cast(myEdgeToFaces.Size()); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdgeToFaces); ++anEdgeId) { - const NCollection_Vector* aFaces = seekVec(myEdgeToFaces, anEdgeId.Index); + const NCollection_DynamicArray* aFaces = + seekVec(myEdgeToFaces, anEdgeId.Index); if (aFaces == nullptr) { continue; @@ -1626,7 +1627,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbFaceToShells = static_cast(myFaceToShells.Size()); for (BRepGraph_FaceId aFaceId(0); aFaceId.IsValid(aNbFaceToShells); ++aFaceId) { - const NCollection_Vector* aShellsVec = + const NCollection_DynamicArray* aShellsVec = seekVec(myFaceToShells, aFaceId.Index); if (aShellsVec == nullptr) { @@ -1648,7 +1649,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbShellToSolids = static_cast(myShellToSolids.Size()); for (BRepGraph_ShellId aShellId(0); aShellId.IsValid(aNbShellToSolids); ++aShellId) { - const NCollection_Vector* aSolidsVec = + const NCollection_DynamicArray* aSolidsVec = seekVec(myShellToSolids, aShellId.Index); if (aSolidsVec == nullptr) { @@ -1670,7 +1671,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfSolid = static_cast(myCompoundsOfSolid.Size()); for (BRepGraph_SolidId aSolidId(0); aSolidId.IsValid(aNbCompoundsOfSolid); ++aSolidId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfSolid, aSolidId.Index); if (aCompoundsVec == nullptr) { @@ -1692,7 +1693,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompSolidsOfSolid = static_cast(myCompSolidsOfSolid.Size()); for (BRepGraph_SolidId aSolidId(0); aSolidId.IsValid(aNbCompSolidsOfSolid); ++aSolidId) { - const NCollection_Vector* aCompSolidsVec = + const NCollection_DynamicArray* aCompSolidsVec = seekVec(myCompSolidsOfSolid, aSolidId.Index); if (aCompSolidsVec == nullptr) { @@ -1714,7 +1715,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfShell = static_cast(myCompoundsOfShell.Size()); for (BRepGraph_ShellId aShellId(0); aShellId.IsValid(aNbCompoundsOfShell); ++aShellId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfShell, aShellId.Index); if (aCompoundsVec == nullptr) { @@ -1736,7 +1737,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfFace = static_cast(myCompoundsOfFace.Size()); for (BRepGraph_FaceId aFaceId(0); aFaceId.IsValid(aNbCompoundsOfFace); ++aFaceId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfFace, aFaceId.Index); if (aCompoundsVec == nullptr) { @@ -1759,7 +1760,7 @@ bool BRepGraphInc_ReverseIndex::Validate( for (BRepGraph_CompoundId aCompoundId(0); aCompoundId.IsValid(aNbCompoundsOfCompound); ++aCompoundId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfCompound, aCompoundId.Index); if (aCompoundsVec == nullptr) { @@ -1782,7 +1783,7 @@ bool BRepGraphInc_ReverseIndex::Validate( for (BRepGraph_CompSolidId aCompSolidId(0); aCompSolidId.IsValid(aNbCompoundsOfCompSolid); ++aCompSolidId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfCompSolid, aCompSolidId.Index); if (aCompoundsVec == nullptr) { @@ -1805,7 +1806,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfWire = static_cast(myCompoundsOfWire.Size()); for (BRepGraph_WireId aWireId(0); aWireId.IsValid(aNbCompoundsOfWire); ++aWireId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfWire, aWireId.Index); if (aCompoundsVec == nullptr) { @@ -1828,7 +1829,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfEdge = static_cast(myCompoundsOfEdge.Size()); for (BRepGraph_EdgeId anEdgeId2(0); anEdgeId2.IsValid(aNbCompoundsOfEdge); ++anEdgeId2) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfEdge, anEdgeId2.Index); if (aCompoundsVec == nullptr) { @@ -1851,7 +1852,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCompoundsOfVertex = static_cast(myCompoundsOfVertex.Size()); for (BRepGraph_VertexId aVertexId(0); aVertexId.IsValid(aNbCompoundsOfVertex); ++aVertexId) { - const NCollection_Vector* aCompoundsVec = + const NCollection_DynamicArray* aCompoundsVec = seekVec(myCompoundsOfVertex, aVertexId.Index); if (aCompoundsVec == nullptr) { @@ -1874,7 +1875,7 @@ bool BRepGraphInc_ReverseIndex::Validate( const uint32_t aNbCoEdgeToWires = static_cast(myCoEdgeToWires.Size()); for (BRepGraph_CoEdgeId aCoEdgeId2(0); aCoEdgeId2.IsValid(aNbCoEdgeToWires); ++aCoEdgeId2) { - const NCollection_Vector* aWiresVec = + const NCollection_DynamicArray* aWiresVec = seekVec(myCoEdgeToWires, aCoEdgeId2.Index); if (aWiresVec == nullptr) { @@ -1920,8 +1921,8 @@ bool BRepGraphInc_ReverseIndex::Validate( //================================================================================================= void BRepGraphInc_ReverseIndex::BuildProductOccurrences( - const NCollection_Vector& theOccurrences, - const uint32_t theNbProducts) + const NCollection_DynamicArray& theOccurrences, + const uint32_t theNbProducts) { myProductToOccurrences.Clear(); preSize(myProductToOccurrences, theNbProducts, myAllocator); diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.hxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.hxx index 7767e1873d..3af0ce034a 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.hxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_ReverseIndex.hxx @@ -16,7 +16,7 @@ #include #include -#include +#include #include class BRepGraphInc_Storage; @@ -91,22 +91,23 @@ public: //! @param[in] theSolidRefs solid ref-entry table (compsolid -> solid reverse) //! @param[in] theChildRefs child ref-entry table (compound child reverse) //! @param[in] theVertexRefs vertex ref-entry table (edge vertex resolution) - Standard_EXPORT void Build(const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs); + Standard_EXPORT void Build( + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs); //! Incrementally update reverse indices for entities/ref-parents appended after a previous //! ReverseIndex::Build(). Only processes entities from the old counts to the current vector @@ -121,55 +122,55 @@ public: //! @param[in] theOldNbChildRefs ChildRef count before the append operation //! @param[in] theOldNbSolidRefs SolidRef count before the append operation Standard_EXPORT void BuildDelta( - const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs, - const uint32_t theOldNbEdges, - const uint32_t theOldNbWires, - const uint32_t theOldNbFaces, - const uint32_t theOldNbShells, - const uint32_t theOldNbSolids, - const uint32_t theOldNbCompounds, - const uint32_t theOldNbCompSolids, - const uint32_t theOldNbChildRefs, - const uint32_t theOldNbSolidRefs); + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs, + const uint32_t theOldNbEdges, + const uint32_t theOldNbWires, + const uint32_t theOldNbFaces, + const uint32_t theOldNbShells, + const uint32_t theOldNbSolids, + const uint32_t theOldNbCompounds, + const uint32_t theOldNbCompSolids, + const uint32_t theOldNbChildRefs, + const uint32_t theOldNbSolidRefs); //! Build product-to-occurrences reverse index. //! @param[in] theOccurrences occurrence entity vector //! @param[in] theNbProducts total number of products (for pre-sizing) Standard_EXPORT void BuildProductOccurrences( - const NCollection_Vector& theOccurrences, - const uint32_t theNbProducts); + const NCollection_DynamicArray& theOccurrences, + const uint32_t theNbProducts); //! Return wire indices containing the given edge. - [[nodiscard]] const NCollection_Vector* WiresOfEdge( + [[nodiscard]] const NCollection_DynamicArray* WiresOfEdge( const BRepGraph_EdgeId theEdgeId) const { return seekVec(myEdgeToWires, theEdgeId.Index); } //! Return face indices containing the given edge (derived from CoEdge.FaceDefId links). - [[nodiscard]] const NCollection_Vector* FacesOfEdge( + [[nodiscard]] const NCollection_DynamicArray* FacesOfEdge( const BRepGraph_EdgeId theEdgeId) const { return seekVec(myEdgeToFaces, theEdgeId.Index); } //! Return coedge indices referencing the given edge. - [[nodiscard]] const NCollection_Vector* CoEdgesOfEdge( + [[nodiscard]] const NCollection_DynamicArray* CoEdgesOfEdge( const BRepGraph_EdgeId theEdgeId) const { return seekVec(myEdgeToCoEdges, theEdgeId.Index); @@ -179,75 +180,76 @@ public: //! Derived directly from the edge-to-faces adjacency vector to keep a single source of truth. [[nodiscard]] uint32_t NbFacesOfEdge(const BRepGraph_EdgeId theEdgeId) const { - const NCollection_Vector* aFaces = seekVec(myEdgeToFaces, theEdgeId.Index); + const NCollection_DynamicArray* aFaces = + seekVec(myEdgeToFaces, theEdgeId.Index); return aFaces != nullptr ? static_cast(aFaces->Size()) : 0u; } //! Return edge indices incident to the given vertex. - [[nodiscard]] const NCollection_Vector* EdgesOfVertex( + [[nodiscard]] const NCollection_DynamicArray* EdgesOfVertex( const BRepGraph_VertexId theVertexId) const { return seekVec(myVertexToEdges, theVertexId.Index); } //! Return face indices containing the given wire. - [[nodiscard]] const NCollection_Vector* FacesOfWire( + [[nodiscard]] const NCollection_DynamicArray* FacesOfWire( const BRepGraph_WireId theWireId) const { return seekVec(myWireToFaces, theWireId.Index); } //! Return shell indices containing the given face. - [[nodiscard]] const NCollection_Vector* ShellsOfFace( + [[nodiscard]] const NCollection_DynamicArray* ShellsOfFace( const BRepGraph_FaceId theFaceId) const { return seekVec(myFaceToShells, theFaceId.Index); } //! Return solid indices containing the given shell. - [[nodiscard]] const NCollection_Vector* SolidsOfShell( + [[nodiscard]] const NCollection_DynamicArray* SolidsOfShell( const BRepGraph_ShellId theShellId) const { return seekVec(myShellToSolids, theShellId.Index); } //! Return compound indices containing the given solid as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfSolid( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfSolid( const BRepGraph_SolidId theSolidId) const { return seekVec(myCompoundsOfSolid, theSolidId.Index); } //! Return compsolid indices containing the given solid as a SolidInstance. - [[nodiscard]] const NCollection_Vector* CompSolidsOfSolid( + [[nodiscard]] const NCollection_DynamicArray* CompSolidsOfSolid( const BRepGraph_SolidId theSolidId) const { return seekVec(myCompSolidsOfSolid, theSolidId.Index); } //! Return compound indices containing the given shell as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfShell( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfShell( const BRepGraph_ShellId theShellId) const { return seekVec(myCompoundsOfShell, theShellId.Index); } //! Return compound indices containing the given face as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfFace( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfFace( const BRepGraph_FaceId theFaceId) const { return seekVec(myCompoundsOfFace, theFaceId.Index); } //! Return compound indices containing the given compound as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfCompound( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfCompound( const BRepGraph_CompoundId theCompoundId) const { return seekVec(myCompoundsOfCompound, theCompoundId.Index); } //! Return compound indices containing the given compsolid as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfCompSolid( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfCompSolid( const BRepGraph_CompSolidId theCompSolidId) const { return seekVec(myCompoundsOfCompSolid, theCompSolidId.Index); @@ -256,35 +258,35 @@ public: //! Return compound indices containing the given wire as a NodeInstance. //! OCCT `TopoDS_Compound` can legally hold atomic topology (wire / edge / //! vertex); these reverse maps round-trip that case. - [[nodiscard]] const NCollection_Vector* CompoundsOfWire( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfWire( const BRepGraph_WireId theWireId) const { return seekVec(myCompoundsOfWire, theWireId.Index); } //! Return compound indices containing the given edge as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfEdge( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfEdge( const BRepGraph_EdgeId theEdgeId) const { return seekVec(myCompoundsOfEdge, theEdgeId.Index); } //! Return compound indices containing the given vertex as a NodeInstance. - [[nodiscard]] const NCollection_Vector* CompoundsOfVertex( + [[nodiscard]] const NCollection_DynamicArray* CompoundsOfVertex( const BRepGraph_VertexId theVertexId) const { return seekVec(myCompoundsOfVertex, theVertexId.Index); } //! Return wire indices containing the given coedge. - [[nodiscard]] const NCollection_Vector* WiresOfCoEdge( + [[nodiscard]] const NCollection_DynamicArray* WiresOfCoEdge( const BRepGraph_CoEdgeId theCoEdgeId) const { return seekVec(myCoEdgeToWires, theCoEdgeId.Index); } //! Return occurrence indices that reference the given product. - [[nodiscard]] const NCollection_Vector* OccurrencesOfProduct( + [[nodiscard]] const NCollection_DynamicArray* OccurrencesOfProduct( const BRepGraph_ProductId theProductId) const { return seekVec(myProductToOccurrences, theProductId.Index); @@ -293,49 +295,49 @@ public: // --- Safe reference accessors (return empty vector instead of nullptr) --- //! Return wire indices containing the given edge (safe reference, never null). - [[nodiscard]] const NCollection_Vector& WiresOfEdgeRef( + [[nodiscard]] const NCollection_DynamicArray& WiresOfEdgeRef( const BRepGraph_EdgeId theEdgeId) const { return seekRef(myEdgeToWires, theEdgeId.Index); } //! Return face indices containing the given edge (safe reference, never null). - [[nodiscard]] const NCollection_Vector& FacesOfEdgeRef( + [[nodiscard]] const NCollection_DynamicArray& FacesOfEdgeRef( const BRepGraph_EdgeId theEdgeId) const { return seekRef(myEdgeToFaces, theEdgeId.Index); } //! Return coedge indices referencing the given edge (safe reference, never null). - [[nodiscard]] const NCollection_Vector& CoEdgesOfEdgeRef( + [[nodiscard]] const NCollection_DynamicArray& CoEdgesOfEdgeRef( const BRepGraph_EdgeId theEdgeId) const { return seekRef(myEdgeToCoEdges, theEdgeId.Index); } //! Return face indices containing the given wire (safe reference, never null). - [[nodiscard]] const NCollection_Vector& FacesOfWireRef( + [[nodiscard]] const NCollection_DynamicArray& FacesOfWireRef( const BRepGraph_WireId theWireId) const { return seekRef(myWireToFaces, theWireId.Index); } //! Return edge indices incident to the given vertex (safe reference, never null). - [[nodiscard]] const NCollection_Vector& EdgesOfVertexRef( + [[nodiscard]] const NCollection_DynamicArray& EdgesOfVertexRef( const BRepGraph_VertexId theVertexId) const { return seekRef(myVertexToEdges, theVertexId.Index); } //! Return shell indices containing the given face (safe reference, never null). - [[nodiscard]] const NCollection_Vector& ShellsOfFaceRef( + [[nodiscard]] const NCollection_DynamicArray& ShellsOfFaceRef( const BRepGraph_FaceId theFaceId) const { return seekRef(myFaceToShells, theFaceId.Index); } //! Return solid indices containing the given shell (safe reference, never null). - [[nodiscard]] const NCollection_Vector& SolidsOfShellRef( + [[nodiscard]] const NCollection_DynamicArray& SolidsOfShellRef( const BRepGraph_ShellId theShellId) const { return seekRef(myShellToSolids, theShellId.Index); @@ -346,22 +348,22 @@ public: //! reverse entry exists (edge->wire). Intended for debug validation. //! @return true if all forward refs have matching reverse entries Standard_EXPORT bool Validate( - const NCollection_Vector& theVertices, - const NCollection_Vector& theEdges, - const NCollection_Vector& theCoEdges, - const NCollection_Vector& theWires, - const NCollection_Vector& theFaces, - const NCollection_Vector& theShells, - const NCollection_Vector& theSolids, - const NCollection_Vector& theCompounds, - const NCollection_Vector& theCompSolids, - const NCollection_Vector& theShellRefs, - const NCollection_Vector& theFaceRefs, - const NCollection_Vector& theWireRefs, - const NCollection_Vector& theCoEdgeRefs, - const NCollection_Vector& theSolidRefs, - const NCollection_Vector& theChildRefs, - const NCollection_Vector& theVertexRefs) const; + const NCollection_DynamicArray& theVertices, + const NCollection_DynamicArray& theEdges, + const NCollection_DynamicArray& theCoEdges, + const NCollection_DynamicArray& theWires, + const NCollection_DynamicArray& theFaces, + const NCollection_DynamicArray& theShells, + const NCollection_DynamicArray& theSolids, + const NCollection_DynamicArray& theCompounds, + const NCollection_DynamicArray& theCompSolids, + const NCollection_DynamicArray& theShellRefs, + const NCollection_DynamicArray& theFaceRefs, + const NCollection_DynamicArray& theWireRefs, + const NCollection_DynamicArray& theCoEdgeRefs, + const NCollection_DynamicArray& theSolidRefs, + const NCollection_DynamicArray& theChildRefs, + const NCollection_DynamicArray& theVertexRefs) const; // --- Incremental mutation --- @@ -413,28 +415,28 @@ public: private: //! Dense vector type: outer index = entity key, inner vector = typed adjacency list. template - using TypedIndexTable = NCollection_Vector>; + using TypedIndexTable = NCollection_DynamicArray>; //! Bounds-checked lookup returning nullptr for out-of-range or empty slots. template - static const NCollection_Vector* seekVec(const TypedIndexTable& theIdx, - const uint32_t theKey) + static const NCollection_DynamicArray* seekVec(const TypedIndexTable& theIdx, + const uint32_t theKey) { if (theKey >= theIdx.Size()) return nullptr; - const NCollection_Vector& aVec = theIdx.Value(static_cast(theKey)); + const NCollection_DynamicArray& aVec = theIdx.Value(static_cast(theKey)); return aVec.IsEmpty() ? nullptr : &aVec; } //! Bounds-checked lookup returning a const reference (empty vector for missing keys). template - static const NCollection_Vector& seekRef(const TypedIndexTable& theIdx, - const uint32_t theKey) + static const NCollection_DynamicArray& seekRef(const TypedIndexTable& theIdx, + const uint32_t theKey) { - const NCollection_Vector* aPtr = seekVec(theIdx, theKey); + const NCollection_DynamicArray* aPtr = seekVec(theIdx, theKey); if (aPtr != nullptr) return *aPtr; - static const NCollection_Vector THE_EMPTY; + static const NCollection_DynamicArray THE_EMPTY; return THE_EMPTY; } @@ -453,7 +455,7 @@ private: { for (size_t i = theIdx.Size(), aNb = static_cast(theSize); i < aNb; ++i) { - theIdx.Append(NCollection_Vector(16, theAlloc)); + theIdx.Append(NCollection_DynamicArray(16, theAlloc)); } } else @@ -468,7 +470,7 @@ private: //! Ensure theVec has at least theSize elements. //! New elements are default-constructed (zero for scalar types). template - static void ensureSize(NCollection_Vector& theVec, const uint32_t theSize) + static void ensureSize(NCollection_DynamicArray& theVec, const uint32_t theSize) { while (theVec.Size() < static_cast(theSize)) { @@ -494,7 +496,7 @@ private: if (theKey >= theIdx.Size()) ensureSize(theIdx, theKey + 1u); - NCollection_Vector& aVec = theIdx.ChangeValue(static_cast(theKey)); + NCollection_DynamicArray& aVec = theIdx.ChangeValue(static_cast(theKey)); for (const T& anElem : aVec) { if (anElem == theVal) diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.cxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.cxx index 284c06ad66..32b3c2d703 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.cxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.cxx @@ -19,7 +19,7 @@ namespace { template -bool containsNodeIndex(const NCollection_Vector* theVec, const uint32_t theIndex) +bool containsNodeIndex(const NCollection_DynamicArray* theVec, const uint32_t theIndex) { if (theVec == nullptr) { @@ -86,7 +86,7 @@ BRepGraphInc_Storage::BRepGraphInc_Storage(const occ::handle& BRepGraphInc_Storage::UIDs( +const NCollection_DynamicArray& BRepGraphInc_Storage::UIDs( const BRepGraph_NodeId::Kind theKind) const { switch (theKind) @@ -117,13 +117,13 @@ const NCollection_Vector& BRepGraphInc_Storage::UIDs( break; } Standard_ASSERT_VOID(false, "UIDs: unhandled Kind"); - static const NCollection_Vector THE_EMPTY; + static const NCollection_DynamicArray THE_EMPTY; return THE_EMPTY; } //================================================================================================= -NCollection_Vector& BRepGraphInc_Storage::ChangeUIDs( +NCollection_DynamicArray& BRepGraphInc_Storage::ChangeUIDs( const BRepGraph_NodeId::Kind theKind) { switch (theKind) @@ -174,7 +174,7 @@ void BRepGraphInc_Storage::ResetAllUIDs() //================================================================================================= -const NCollection_Vector& BRepGraphInc_Storage::RefUIDs( +const NCollection_DynamicArray& BRepGraphInc_Storage::RefUIDs( const BRepGraph_RefId::Kind theKind) const { switch (theKind) @@ -199,13 +199,13 @@ const NCollection_Vector& BRepGraphInc_Storage::RefUIDs( break; } Standard_ASSERT_VOID(false, "RefUIDs: unhandled Kind"); - static const NCollection_Vector THE_EMPTY; + static const NCollection_DynamicArray THE_EMPTY; return THE_EMPTY; } //================================================================================================= -NCollection_Vector& BRepGraphInc_Storage::ChangeRefUIDs( +NCollection_DynamicArray& BRepGraphInc_Storage::ChangeRefUIDs( const BRepGraph_RefId::Kind theKind) { switch (theKind) @@ -661,7 +661,8 @@ bool BRepGraphInc_Storage::ValidateReverseIndex() const for (BRepGraph_EdgeId anEdgeId = BRepGraph_EdgeId::Start(); anEdgeId.IsValid(myEdges.Nb()); ++anEdgeId) { - const NCollection_Vector* aCoEdges = myReverseIdx.CoEdgesOfEdge(anEdgeId); + const NCollection_DynamicArray* aCoEdges = + myReverseIdx.CoEdgesOfEdge(anEdgeId); if (aCoEdges == nullptr) { continue; @@ -836,7 +837,7 @@ bool BRepGraphInc_Storage::ValidateReverseIndex() const aProductId.IsValid(myProducts.Nb()); ++aProductId) { - const NCollection_Vector* anOccs = + const NCollection_DynamicArray* anOccs = myReverseIdx.OccurrencesOfProduct(aProductId); if (anOccs == nullptr) { diff --git a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.hxx b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.hxx index 4700d5295e..791bf56e02 100644 --- a/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.hxx +++ b/src/ModelingData/TKBRep/BRepGraphInc/BRepGraphInc_Storage.hxx @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -670,11 +670,11 @@ public: BRepGraph_OccurrenceRefId AppendOccurrenceRef() { return myOccurrenceRefs.Append(); } //! Return the per-kind UID vector for a given Kind. - [[nodiscard]] Standard_EXPORT const NCollection_Vector& UIDs( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& UIDs( const BRepGraph_NodeId::Kind theKind) const; //! Return the per-kind UID vector for a given Kind (mutable). - Standard_EXPORT NCollection_Vector& ChangeUIDs( + Standard_EXPORT NCollection_DynamicArray& ChangeUIDs( const BRepGraph_NodeId::Kind theKind); //! Clear all UID vectors (reset lengths to 0). @@ -692,11 +692,11 @@ public: Standard_EXPORT BRepGraphInc::BaseRef& ChangeBaseRef(const BRepGraph_RefId theRefId); //! Return the per-kind transitional reference UID vector. - [[nodiscard]] Standard_EXPORT const NCollection_Vector& RefUIDs( + [[nodiscard]] Standard_EXPORT const NCollection_DynamicArray& RefUIDs( const BRepGraph_RefId::Kind theKind) const; //! Return the per-kind transitional reference UID vector (mutable). - Standard_EXPORT NCollection_Vector& ChangeRefUIDs( + Standard_EXPORT NCollection_DynamicArray& ChangeRefUIDs( const BRepGraph_RefId::Kind theKind); //! Clear all transitional reference UID vectors. @@ -820,9 +820,9 @@ private: using TypeId = typename EntityT::TypeId; using ValueType = EntityT; - NCollection_Vector Entities; - NCollection_Vector UIDs; - uint32_t NbActive = 0; + NCollection_DynamicArray Entities; + NCollection_DynamicArray UIDs; + uint32_t NbActive = 0; DefStore() = default; @@ -893,8 +893,8 @@ private: using TypeId = typename RepT::TypeId; using ValueType = RepT; - NCollection_Vector Entities; - uint32_t NbActive = 0; + NCollection_DynamicArray Entities; + uint32_t NbActive = 0; RepStore() = default; @@ -973,9 +973,9 @@ private: using TypeId = typename RefT::TypeId; using ValueType = RefT; - NCollection_Vector Refs; - NCollection_Vector UIDs; - uint32_t NbActive = 0; + NCollection_DynamicArray Refs; + NCollection_DynamicArray UIDs; + uint32_t NbActive = 0; RefStore() = default; diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx index ae4b82fefa..639e9ffd41 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -37,8 +37,8 @@ bool BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape) AddShape(myShape); // Check locations; - int ind; - NCollection_Vector aBadTrsfInds; + int ind; + NCollection_DynamicArray aBadTrsfInds; for (ind = 1;; ++ind) { const TopLoc_Location& aLoc = myLocations.Location(ind); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraphInc_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraphInc_Test.cxx index 049ee5ada0..8ea5e40103 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraphInc_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraphInc_Test.cxx @@ -396,7 +396,7 @@ TEST(BRepGraphIncTest, Box_ReverseIndex_EdgesToWires) const int aNbEdges = aStorage.NbEdges(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges); ++anEdgeId) { - const NCollection_Vector* aWires = + const NCollection_DynamicArray* aWires = aStorage.ReverseIndex().WiresOfEdge(anEdgeId); EXPECT_TRUE(aWires != nullptr) << "Edge " << anEdgeId.Index << " not in any wire"; if (aWires != nullptr) @@ -421,7 +421,7 @@ TEST(BRepGraphIncTest, Box_ReverseIndex_EdgesToFaces) { if (aStorage.Edge(anEdgeId).IsDegenerate) continue; - const NCollection_Vector* aFaces = + const NCollection_DynamicArray* aFaces = aStorage.ReverseIndex().FacesOfEdge(anEdgeId); EXPECT_TRUE(aFaces != nullptr) << "Edge " << anEdgeId.Index << " not in any face"; if (aFaces != nullptr) @@ -521,7 +521,7 @@ TEST(BRepGraphIncTest, Box_CoEdgeCount) const int aNbEdges = aStorage.NbEdges(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges); ++anEdgeId) { - const NCollection_Vector* aCoEdgeIdxs = + const NCollection_DynamicArray* aCoEdgeIdxs = aStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdgeIdxs != nullptr) aCoEdgeCount += aCoEdgeIdxs->Length(); @@ -543,7 +543,7 @@ TEST(BRepGraphIncTest, Cylinder_HasSeamEdges) const int aNbEdges = aStorage.NbEdges(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges); ++anEdgeId) { - const NCollection_Vector* aCoEdgeIdxs = + const NCollection_DynamicArray* aCoEdgeIdxs = aStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdgeIdxs == nullptr) continue; @@ -574,7 +574,7 @@ TEST(BRepGraphIncTest, Cylinder_SeamEdge_ReverseIndex_NoDuplicateFace) const int aNbEdges = aStorage.NbEdges(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges); ++anEdgeId) { - const NCollection_Vector* aFaces = + const NCollection_DynamicArray* aFaces = aStorage.ReverseIndex().FacesOfEdge(anEdgeId); if (aFaces == nullptr) continue; @@ -1222,7 +1222,7 @@ TEST(BRepGraphIncTest, ReverseIndex_Validate_CompoundWithAtomicWire) ASSERT_GE(aStorage.NbWires(), 1); // The wire must appear in myCompoundsOfWire. - const NCollection_Vector* aCmpVec = + const NCollection_DynamicArray* aCmpVec = aStorage.ReverseIndex().CompoundsOfWire(BRepGraph_WireId::Start()); EXPECT_NE(aCmpVec, nullptr) << "Wire(0) should appear in myCompoundsOfWire"; if (aCmpVec != nullptr) @@ -1253,7 +1253,7 @@ TEST(BRepGraphIncTest, ReverseIndex_Validate_CompoundWithAtomicEdge) EXPECT_EQ(aStorage.NbCompounds(), 1); ASSERT_GE(aStorage.NbEdges(), 1); - const NCollection_Vector* aCmpVec = + const NCollection_DynamicArray* aCmpVec = aStorage.ReverseIndex().CompoundsOfEdge(BRepGraph_EdgeId::Start()); EXPECT_NE(aCmpVec, nullptr) << "Edge(0) should appear in myCompoundsOfEdge"; if (aCmpVec != nullptr) @@ -1283,7 +1283,7 @@ TEST(BRepGraphIncTest, ReverseIndex_Validate_CompoundWithAtomicVertex) EXPECT_EQ(aStorage.NbCompounds(), 1); ASSERT_GE(aStorage.NbVertices(), 1); - const NCollection_Vector* aCmpVec = + const NCollection_DynamicArray* aCmpVec = aStorage.ReverseIndex().CompoundsOfVertex(BRepGraph_VertexId::Start()); EXPECT_NE(aCmpVec, nullptr) << "Vertex(0) should appear in myCompoundsOfVertex"; if (aCmpVec != nullptr) @@ -1312,7 +1312,7 @@ TEST(BRepGraphIncTest, ReverseIndex_CoEdgeToWire_IsPopulated) const BRepGraphInc::CoEdgeDef& aCE = aStorage.CoEdge(aCoEdgeId); if (aCE.IsRemoved) continue; - const NCollection_Vector* aWires = + const NCollection_DynamicArray* aWires = aStorage.ReverseIndex().WiresOfCoEdge(aCoEdgeId); EXPECT_NE(aWires, nullptr) << "CoEdge " << aCoEdgeId.Index << " not in any wire"; if (aWires != nullptr) @@ -1351,7 +1351,7 @@ TEST(BRepGraphIncTest, ReverseIndex_CompSolid_ReverseMaintained_AfterBuild) aSolidId.IsValid(aStorage.NbSolids()); ++aSolidId) { - const NCollection_Vector* aCSVec = + const NCollection_DynamicArray* aCSVec = aStorage.ReverseIndex().CompSolidsOfSolid(aSolidId); EXPECT_NE(aCSVec, nullptr) << "Solid " << aSolidId.Index << " not in any CompSolid"; if (aCSVec != nullptr) @@ -1386,7 +1386,7 @@ TEST(BRepGraphIncTest, ReverseIndex_CompSolid_ReverseMaintained_AfterBuildDelta) EXPECT_TRUE(aStorage.ValidateReverseIndex()); - const NCollection_Vector* aCSVec = + const NCollection_DynamicArray* aCSVec = aStorage.ReverseIndex().CompSolidsOfSolid(BRepGraph_SolidId::Start()); EXPECT_NE(aCSVec, nullptr) << "Solid 0 should be indexed in CompSolidsOfSolid"; } diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Assembly_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Assembly_Test.cxx index ee7a107b64..fd01d80378 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Assembly_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Assembly_Test.cxx @@ -41,9 +41,9 @@ static double translationX(const TopoDS_Shape& theShape) return theShape.Location().Transformation().TranslationPart().X(); } -NCollection_Vector collectRootProducts(const BRepGraph& theGraph) +NCollection_DynamicArray collectRootProducts(const BRepGraph& theGraph) { - NCollection_Vector aRoots(4); + NCollection_DynamicArray aRoots(4); for (BRepGraph_RootProductIterator aRootIt(theGraph); aRootIt.More(); aRootIt.Next()) { aRoots.Append(aRootIt.Current()); @@ -51,8 +51,8 @@ NCollection_Vector collectRootProducts(const BRepGraph& the return aRoots; } -bool hasRootProduct(const NCollection_Vector& theRoots, - const BRepGraph_ProductId theProduct) +bool hasRootProduct(const NCollection_DynamicArray& theRoots, + const BRepGraph_ProductId theProduct) { for (const BRepGraph_ProductId& aRoot : theRoots) { @@ -256,7 +256,7 @@ TEST(BRepGraph_AssemblyTest, RootProductIds_Query) ASSERT_TRUE(aGraph.IsDone()); // Auto-created root product is the first root. - NCollection_Vector aRoots = collectRootProducts(aGraph); + NCollection_DynamicArray aRoots = collectRootProducts(aGraph); EXPECT_EQ(aRoots.Length(), 1); EXPECT_EQ(aRoots.Value(0), BRepGraph_ProductId::Start()); @@ -286,7 +286,7 @@ TEST(BRepGraph_AssemblyTest, RootProductIds_ShapelessRootAssembly_UsesProductId) ASSERT_TRUE( aGraph.Editor().Products().AddOccurrence(aAssemblyId, aPartId, TopLoc_Location()).IsValid()); - const NCollection_Vector& aRoots = aGraph.RootProductIds(); + const NCollection_DynamicArray& aRoots = aGraph.RootProductIds(); ASSERT_EQ(aRoots.Length(), 1); EXPECT_EQ(aRoots.Value(0), aAssemblyId); } @@ -301,7 +301,7 @@ TEST(BRepGraph_AssemblyTest, RootProductIds_ReflectsAssemblyMutation) BRepGraph_Builder::Perform(aGraph, BRepPrimAPI_MakeBox(10.0, 10.0, 10.0).Shape()); ASSERT_TRUE(aGraph.IsDone()); - const NCollection_Vector aRootsBefore = collectRootProducts(aGraph); + const NCollection_DynamicArray aRootsBefore = collectRootProducts(aGraph); ASSERT_EQ(aRootsBefore.Length(), 1); EXPECT_EQ(aRootsBefore.Value(0), BRepGraph_ProductId::Start()); @@ -310,7 +310,7 @@ TEST(BRepGraph_AssemblyTest, RootProductIds_ReflectsAssemblyMutation) BRepGraph_ProductId::Start(), TopLoc_Location()); - const NCollection_Vector aRootsAfter = collectRootProducts(aGraph); + const NCollection_DynamicArray aRootsAfter = collectRootProducts(aGraph); ASSERT_EQ(aRootsAfter.Length(), 1); EXPECT_EQ(aRootsAfter.Value(0), aAssemblyId); } @@ -331,7 +331,7 @@ TEST(BRepGraph_AssemblyTest, RemoveOccurrence_UpdatesParent) aGraph.Editor().Products().AddOccurrence(aAssemblyId, aPartId, TopLoc_Location()); EXPECT_EQ(aGraph.Topo().Products().NbComponents(aAssemblyId), 1); - const NCollection_Vector& aBeforeRefs = + const NCollection_DynamicArray& aBeforeRefs = aGraph.Refs().Occurrences().IdsOf(aAssemblyId); ASSERT_EQ(aBeforeRefs.Length(), 1); const BRepGraph_OccurrenceRefId anOccRefId = aBeforeRefs.Value(0); @@ -342,7 +342,7 @@ TEST(BRepGraph_AssemblyTest, RemoveOccurrence_UpdatesParent) EXPECT_TRUE(aGraph.Topo().Gen().IsRemoved(anOccId)); EXPECT_EQ(aGraph.Topo().Products().NbComponents(aAssemblyId), 0); - const NCollection_Vector& anAfterRefs = + const NCollection_DynamicArray& anAfterRefs = aGraph.Refs().Occurrences().IdsOf(aAssemblyId); EXPECT_EQ(anAfterRefs.Length(), 0); EXPECT_TRUE(aGraph.Refs().Occurrences().Entry(anOccRefId).IsRemoved); @@ -485,7 +485,7 @@ TEST(BRepGraph_AssemblyTest, MutOccurrenceRef_LocalLocation) ASSERT_TRUE(anOccId.IsValid()); // Find the OccurrenceRefId for the occurrence. - const NCollection_Vector& aOccRefs = + const NCollection_DynamicArray& aOccRefs = aGraph.Refs().Occurrences().IdsOf(aAssemblyId); ASSERT_EQ(aOccRefs.Length(), 1); const BRepGraph_OccurrenceRefId anOccRefId = aOccRefs.Value(0); @@ -742,7 +742,7 @@ TEST(BRepGraph_AssemblyTest, RootProducts_RemovedOccurrence_DoesNotAffectRoots) aGraph.Editor().Products().AddOccurrence(aAssemblyId, aPartId, TopLoc_Location()); // Before removal: only assembly is root (part is referenced). - NCollection_Vector aRoots = collectRootProducts(aGraph); + NCollection_DynamicArray aRoots = collectRootProducts(aGraph); EXPECT_EQ(aRoots.Length(), 1); EXPECT_EQ(aRoots.Value(0), aAssemblyId); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Benchmark_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Benchmark_Test.cxx index 13afe14294..f568bb9905 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Benchmark_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Benchmark_Test.cxx @@ -101,8 +101,8 @@ TEST(BRepGraph_BenchmarkTest, Smoke_BuildReconstructAndAdjacency) const TopoDS_Shape aFaceShape = aGraph.Shapes().Reconstruct(aFaceNodeId); EXPECT_FALSE(aFaceShape.IsNull()); - const BRepGraph_FaceId aFaceId(0); - const NCollection_Vector anAdj = + const BRepGraph_FaceId aFaceId(0); + const NCollection_DynamicArray anAdj = aGraph.Topo().Faces().Adjacent(aFaceId, aGraph.Allocator()); EXPECT_GE(anAdj.Length(), 0); } @@ -199,7 +199,7 @@ TEST(BRepGraph_BenchmarkTest, DISABLED_SpatialQuery_Throughput) const double aAvg = runBenchmark("SpatialQuery 10000 faces", [&]() { for (BRepGraph_FaceIterator aFaceIt(aGraph); aFaceIt.More(); aFaceIt.Next()) { - const NCollection_Vector anAdj = + const NCollection_DynamicArray anAdj = aGraph.Topo().Faces().Adjacent(aFaceIt.CurrentId(), aGraph.Allocator()); EXPECT_GE(anAdj.Length(), 0); } diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Build_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Build_Test.cxx index 0045033c71..22d0d8864f 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Build_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Build_Test.cxx @@ -1121,7 +1121,7 @@ TEST(BRepGraph_BuildTest, RegularityLayer_EdgeMutation_InvalidatesBindings) for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More() && !hasBinding; anEdgeIt.Next()) { anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(anEdgeId); BRepGraph_FaceId aFace1; BRepGraph_FaceId aFace2; @@ -1173,7 +1173,7 @@ TEST(BRepGraph_BuildTest, RegularityLayer_FaceMutation_InvalidatesBindings) for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More() && !hasBinding; anEdgeIt.Next()) { anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(anEdgeId); BRepGraph_FaceId aFace1; BRepGraph_FaceId aFace2; @@ -1331,7 +1331,7 @@ TEST(BRepGraph_BuildTest, RootProductIds_Box_ReturnsOneProduct) ASSERT_TRUE(aGraph.IsDone()); // BRepGraph_Builder::Perform() from a solid should produce exactly one root product. - const NCollection_Vector& aRoots = aGraph.RootProductIds(); + const NCollection_DynamicArray& aRoots = aGraph.RootProductIds(); ASSERT_EQ(aRoots.Length(), 1); // The product's shape root should be a Solid (for a box). @@ -1381,7 +1381,7 @@ TEST(BRepGraph_BuildTest, RootProductIds_AppendFlattenedShape_ProductCountUnchan ASSERT_TRUE(aGraph.IsDone()); // AppendFlattenedShape does not create new products. - const NCollection_Vector& aRoots = aGraph.RootProductIds(); + const NCollection_DynamicArray& aRoots = aGraph.RootProductIds(); EXPECT_EQ(aRoots.Length(), 1); // But a new face was appended. diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Builder_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Builder_Test.cxx index 595e59d5d2..036486cdf4 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Builder_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Builder_Test.cxx @@ -96,7 +96,7 @@ TEST(BRepGraph_BuilderTest, AddWire_ClosedRectangle) BRepGraph_EdgeId aE2 = aGraph.Editor().Edges().Add(aV2, aV3, aL2, 0.0, 10.0, 0.001); BRepGraph_EdgeId aE3 = aGraph.Editor().Edges().Add(aV3, aV0, aL3, 0.0, 10.0, 0.001); - NCollection_Vector> aEdges; + NCollection_DynamicArray> aEdges; aEdges.Append({aE0, TopAbs_FORWARD}); aEdges.Append({aE1, TopAbs_FORWARD}); aEdges.Append({aE2, TopAbs_FORWARD}); @@ -131,7 +131,7 @@ TEST(BRepGraph_BuilderTest, AddFace_WithSurface) BRepGraph_EdgeId aE2 = aGraph.Editor().Edges().Add(aV2, aV3, aL2, 0.0, 10.0, 0.001); BRepGraph_EdgeId aE3 = aGraph.Editor().Edges().Add(aV3, aV0, aL3, 0.0, 10.0, 0.001); - NCollection_Vector> aEdges; + NCollection_DynamicArray> aEdges; aEdges.Append({aE0, TopAbs_FORWARD}); aEdges.Append({aE1, TopAbs_FORWARD}); aEdges.Append({aE2, TopAbs_FORWARD}); @@ -139,8 +139,8 @@ TEST(BRepGraph_BuilderTest, AddFace_WithSurface) BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); - occ::handle aPlane = new Geom_Plane(gp_Pln()); - NCollection_Vector aInnerWires; + occ::handle aPlane = new Geom_Plane(gp_Pln()); + NCollection_DynamicArray aInnerWires; BRepGraph_FaceId aFaceId = aGraph.Editor().Faces().Add(aPlane, aWireId, aInnerWires, 0.001); EXPECT_TRUE(aFaceId.IsValid()); @@ -172,7 +172,7 @@ TEST(BRepGraph_BuilderTest, AddWire_InvalidEdge_ReturnsInvalidAndDoesNotAppend) { BRepGraph aGraph; - NCollection_Vector> anEdges; + NCollection_DynamicArray> anEdges; anEdges.Append({BRepGraph_EdgeId(17), TopAbs_FORWARD}); const BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(anEdges); @@ -185,9 +185,9 @@ TEST(BRepGraph_BuilderTest, AddFace_InvalidOuterWire_ReturnsInvalidAndDoesNotApp { BRepGraph aGraph; - occ::handle aPlane = new Geom_Plane(gp_Pln()); - NCollection_Vector anInnerWires; - const BRepGraph_FaceId aFaceId = + occ::handle aPlane = new Geom_Plane(gp_Pln()); + NCollection_DynamicArray anInnerWires; + const BRepGraph_FaceId aFaceId = aGraph.Editor().Faces().Add(aPlane, BRepGraph_WireId(9), anInnerWires, 0.001); EXPECT_FALSE(aFaceId.IsValid()); @@ -318,15 +318,15 @@ TEST(BRepGraph_BuilderTest, AddFace_CreatesUsage) BRepGraph_EdgeId aE2 = aGraph.Editor().Edges().Add(aV2, aV3, aL2, 0.0, 10.0, 0.001); BRepGraph_EdgeId aE3 = aGraph.Editor().Edges().Add(aV3, aV0, aL3, 0.0, 10.0, 0.001); - NCollection_Vector> aEdges; + NCollection_DynamicArray> aEdges; aEdges.Append({aE0, TopAbs_FORWARD}); aEdges.Append({aE1, TopAbs_FORWARD}); aEdges.Append({aE2, TopAbs_FORWARD}); aEdges.Append({aE3, TopAbs_FORWARD}); - BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); - occ::handle aPlane = new Geom_Plane(gp_Pln()); - NCollection_Vector aInnerWires; + BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); + occ::handle aPlane = new Geom_Plane(gp_Pln()); + NCollection_DynamicArray aInnerWires; BRepGraph_FaceId aFaceId = aGraph.Editor().Faces().Add(aPlane, aWireId, aInnerWires, 0.001); // Create shell and link face to it. @@ -383,7 +383,7 @@ TEST(BRepGraph_BuilderTest, AddCompound_WithChildren) BRepGraph_SolidId aSolid1 = aGraph.Editor().Solids().Add(); BRepGraph_SolidId aSolid2 = aGraph.Editor().Solids().Add(); - NCollection_Vector aChildren; + NCollection_DynamicArray aChildren; aChildren.Append(aSolid1); aChildren.Append(aSolid2); @@ -401,7 +401,7 @@ TEST(BRepGraph_BuilderTest, AddCompSolid_WithSolids) BRepGraph_SolidId aSolid1 = aGraph.Editor().Solids().Add(); BRepGraph_SolidId aSolid2 = aGraph.Editor().Solids().Add(); - NCollection_Vector aSolids; + NCollection_DynamicArray aSolids; aSolids.Append(aSolid1); aSolids.Append(aSolid2); @@ -436,15 +436,15 @@ TEST(BRepGraph_BuilderTest, FullSolid_ProgrammaticConstruction) BRepGraph_EdgeId aE2 = aGraph.Editor().Edges().Add(aV2, aV3, aL2, 0.0, 10.0, 0.001); BRepGraph_EdgeId aE3 = aGraph.Editor().Edges().Add(aV3, aV0, aL3, 0.0, 10.0, 0.001); - NCollection_Vector> aEdges; + NCollection_DynamicArray> aEdges; aEdges.Append({aE0, TopAbs_FORWARD}); aEdges.Append({aE1, TopAbs_FORWARD}); aEdges.Append({aE2, TopAbs_FORWARD}); aEdges.Append({aE3, TopAbs_FORWARD}); - BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); - occ::handle aPlane = new Geom_Plane(gp_Pln()); - NCollection_Vector aInnerWires; + BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); + occ::handle aPlane = new Geom_Plane(gp_Pln()); + NCollection_DynamicArray aInnerWires; BRepGraph_FaceId aFaceId = aGraph.Editor().Faces().Add(aPlane, aWireId, aInnerWires, 0.001); BRepGraph_ShellId aShellId = aGraph.Editor().Shells().Add(); @@ -522,8 +522,8 @@ TEST(BRepGraph_BuilderTest, MutableSolidDefinition) TEST(BRepGraph_BuilderTest, MutableCompoundDefinition) { - BRepGraph aGraph; - NCollection_Vector aChildren; + BRepGraph aGraph; + NCollection_DynamicArray aChildren; (void)aGraph.Editor().Compounds().Add(aChildren); ASSERT_EQ(aGraph.Topo().Compounds().Nb(), 1); @@ -536,8 +536,8 @@ TEST(BRepGraph_BuilderTest, MutableCompoundDefinition) TEST(BRepGraph_BuilderTest, MutableCompSolidDefinition) { - BRepGraph aGraph; - NCollection_Vector aSolids; + BRepGraph aGraph; + NCollection_DynamicArray aSolids; (void)aGraph.Editor().CompSolids().Add(aSolids); ASSERT_EQ(aGraph.Topo().CompSolids().Nb(), 1); @@ -642,15 +642,15 @@ TEST(BRepGraph_BuilderTest, RemoveFace_RemovesWiresAndEdges) BRepGraph_EdgeId aE2 = aGraph.Editor().Edges().Add(aV2, aV3, aL2, 0.0, 10.0, 0.001); BRepGraph_EdgeId aE3 = aGraph.Editor().Edges().Add(aV3, aV0, aL3, 0.0, 10.0, 0.001); - NCollection_Vector> aEdges; + NCollection_DynamicArray> aEdges; aEdges.Append({aE0, TopAbs_FORWARD}); aEdges.Append({aE1, TopAbs_FORWARD}); aEdges.Append({aE2, TopAbs_FORWARD}); aEdges.Append({aE3, TopAbs_FORWARD}); - BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); - occ::handle aPlane = new Geom_Plane(gp_Pln()); - NCollection_Vector aInnerWires; + BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(aEdges); + occ::handle aPlane = new Geom_Plane(gp_Pln()); + NCollection_DynamicArray aInnerWires; BRepGraph_FaceId aFaceId = aGraph.Editor().Faces().Add(aPlane, aWireId, aInnerWires, 0.001); // Remove the face subgraph. @@ -751,7 +751,7 @@ TEST(BRepGraph_BuilderTest, FacesOfEdge_BoxSharedEdge) const int aNbEdges = aGraph.Topo().Edges().Nb(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges); ++anEdgeId) { - NCollection_Vector aFaces = aGraph.Topo().Edges().Faces(anEdgeId); + NCollection_DynamicArray aFaces = aGraph.Topo().Edges().Faces(anEdgeId); EXPECT_EQ(aFaces.Length(), 2) << "Edge " << anEdgeId.Index << " has " << aFaces.Length() << " faces"; } @@ -774,7 +774,7 @@ TEST(BRepGraph_BuilderTest, SharedEdges_AdjacentBoxFaces) { for (BRepGraph_FaceId aFaceB(aFaceA.Index + 1); aFaceB.IsValid(aNbFaces); ++aFaceB) { - NCollection_Vector aShared = + NCollection_DynamicArray aShared = aGraph.Topo().Faces().SharedEdges(aFaceA, aFaceB, aGraph.Allocator()); if (!aShared.IsEmpty()) ++aSharingPairs; @@ -798,7 +798,7 @@ TEST(BRepGraph_BuilderTest, AdjacentFaces_BoxFace) const int aNbFaces = aGraph.Topo().Faces().Nb(); for (BRepGraph_FaceId aFaceId(0); aFaceId.IsValid(aNbFaces); ++aFaceId) { - NCollection_Vector aAdj = + NCollection_DynamicArray aAdj = aGraph.Topo().Faces().Adjacent(aFaceId, aGraph.Allocator()); EXPECT_EQ(aAdj.Length(), 4) << "Face " << aFaceId.Index << " has " << aAdj.Length() << " adjacent faces"; @@ -815,7 +815,7 @@ TEST(BRepGraph_BuilderTest, FacesOfEdge_NoFaces_Programmatic) BRepGraph_EdgeId anEdgeId = aGraph.Editor().Edges().Add(aV0, aV1, aLine, 0.0, 10.0, 0.001); // Edge not in any face => empty result. - const NCollection_Vector& aFaces = aGraph.Topo().Edges().Faces(anEdgeId); + const NCollection_DynamicArray& aFaces = aGraph.Topo().Edges().Faces(anEdgeId); EXPECT_EQ(aFaces.Length(), 0); } @@ -861,7 +861,7 @@ TEST(BRepGraph_BuilderTest, EdgesOfVertex_Box_ThreeEdges) ASSERT_TRUE(aGraph.IsDone()); // Each box corner vertex is shared by 3 edges. - const NCollection_Vector& aEdges = + const NCollection_DynamicArray& aEdges = aGraph.Topo().Vertices().Edges(BRepGraph_VertexId::Start()); EXPECT_EQ(aEdges.Length(), 3); } @@ -874,7 +874,7 @@ TEST(BRepGraph_BuilderTest, AdjacentEdges_Box_SharedVertex) // Box edge shares 2 vertices, each with 3 incident edges. // Adjacent = (3 - 1) + (3 - 1) - overlap = at least 4 adjacent edges. - NCollection_Vector aAdj = + NCollection_DynamicArray aAdj = aGraph.Topo().Edges().Adjacent(BRepGraph_EdgeId::Start(), aGraph.Allocator()); EXPECT_GE(aAdj.Length(), 4); } diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_ChildExplorer_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_ChildExplorer_Test.cxx index c062ad07b8..16c1f834a7 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_ChildExplorer_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_ChildExplorer_Test.cxx @@ -492,11 +492,11 @@ TEST(BRepGraph_ChildExplorerTest, DirectChildren_ShellFaces_CountAndOrder) BRepGraph_Builder::Perform(aGraph, BRepPrimAPI_MakeBox(10, 20, 30).Shape()); ASSERT_TRUE(aGraph.IsDone()); - const BRepGraph_ShellId aShellId(0); - const NCollection_Vector& aFaceRefIds = + const BRepGraph_ShellId aShellId(0); + const NCollection_DynamicArray& aFaceRefIds = aGraph.Refs().Faces().IdsOf(aShellId); - NCollection_Vector anExpectedFaceIds; + NCollection_DynamicArray anExpectedFaceIds; for (const BRepGraph_FaceRefId& aFaceRefId : aFaceRefIds) { const BRepGraphInc::FaceRef& aRef = aGraph.Refs().Faces().Entry(aFaceRefId); @@ -504,7 +504,7 @@ TEST(BRepGraph_ChildExplorerTest, DirectChildren_ShellFaces_CountAndOrder) anExpectedFaceIds.Append(aRef.FaceDefId.Index); } - NCollection_Vector anActualFaceIds; + NCollection_DynamicArray anActualFaceIds; for (BRepGraph_ChildExplorer anIt = makeDirectChildExplorer(aGraph, aShellId, BRepGraph_NodeId::Kind::Face); anIt.More(); @@ -595,7 +595,7 @@ TEST(BRepGraph_ChildExplorerTest, DirectChildren_ProductOccurrences_ExposeOccurr ASSERT_TRUE(anOcc0.IsValid()); ASSERT_TRUE(anOcc1.IsValid()); - const NCollection_Vector& anOccurrenceRefs = + const NCollection_DynamicArray& anOccurrenceRefs = aGraph.Refs().Occurrences().IdsOf(anAssembly); ASSERT_EQ(anOccurrenceRefs.Length(), 2); @@ -618,8 +618,8 @@ TEST(BRepGraph_ChildExplorerTest, DirectChildren_RemovedFaceRef_IsSkipped) BRepGraph_Builder::Perform(aGraph, BRepPrimAPI_MakeBox(10, 20, 30).Shape()); ASSERT_TRUE(aGraph.IsDone()); - const BRepGraph_ShellId aShellId(0); - const NCollection_Vector& aFaceRefIds = + const BRepGraph_ShellId aShellId(0); + const NCollection_DynamicArray& aFaceRefIds = aGraph.Refs().Faces().IdsOf(aShellId); ASSERT_GT(aFaceRefIds.Length(), 0); @@ -651,12 +651,13 @@ TEST(BRepGraph_ChildExplorerTest, DirectChildren_WireChildren_AreCoEdges) BRepGraph_Builder::Perform(aGraph, BRepPrimAPI_MakeBox(10, 20, 30).Shape()); ASSERT_TRUE(aGraph.IsDone()); - const BRepGraph_FaceId aFaceId(0); - const NCollection_Vector& aWireRefs = aGraph.Refs().Wires().IdsOf(aFaceId); + const BRepGraph_FaceId aFaceId(0); + const NCollection_DynamicArray& aWireRefs = + aGraph.Refs().Wires().IdsOf(aFaceId); ASSERT_GT(aWireRefs.Length(), 0); const BRepGraph_WireId aWireId = aGraph.Refs().Wires().Entry(aWireRefs.Value(0)).WireDefId; - const NCollection_Vector& aCoEdgeRefs = + const NCollection_DynamicArray& aCoEdgeRefs = aGraph.Refs().CoEdges().IdsOf(aWireId); // Wire's direct children are CoEdges (no 1:1 collapse). diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Convenience_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Convenience_Test.cxx index 9ce2489007..bc58ac6ec1 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Convenience_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Convenience_Test.cxx @@ -183,8 +183,8 @@ TEST_F(BRepGraph_ConvenienceTest, ShellFaceRefs_Box_SixFaces) TEST_F(BRepGraph_ConvenienceTest, ShellFaceRefs_AllValid) { - const BRepGraph::RefsView& aRefs = myGraph.Refs(); - const NCollection_Vector& aFaceRefIds = + const BRepGraph::RefsView& aRefs = myGraph.Refs(); + const NCollection_DynamicArray& aFaceRefIds = aRefs.Faces().IdsOf(BRepGraph_ShellId::Start()); for (int aFaceIter = 0; aFaceIter < aFaceRefIds.Length(); ++aFaceIter) { @@ -215,7 +215,7 @@ TEST_F(BRepGraph_ConvenienceTest, FindPCurve_WithOrientation_SeamEdge) // Look for seam edges (coedge with SeamPairId valid). for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aDefs.Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Deduplicate_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Deduplicate_Test.cxx index ca1ce45ba1..ee8553c8e4 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Deduplicate_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Deduplicate_Test.cxx @@ -113,8 +113,8 @@ int nbPCurveEntries(const BRepGraph& theGraph) int aCount = 0; for (BRepGraph_EdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = theGraph.Topo().Edges().CoEdges(anEdgeId); for (int i = 0; i < aCoEdgeIdxs.Length(); ++i) { @@ -249,8 +249,8 @@ int nbUniquePCurveNodes(const BRepGraph& theGraph) int aCount = 0; for (BRepGraph_FullEdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = theGraph.Topo().Edges().CoEdges(anEdgeId); aCount += aCoEdgeIdxs.Length(); } @@ -262,8 +262,8 @@ int addDuplicatePCurvesToAllEdges(BRepGraph& theGraph) int aDupCount = 0; for (BRepGraph_FullEdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = theGraph.Topo().Edges().CoEdges(anEdgeId); if (aCoEdgeIdxs.IsEmpty()) { @@ -856,13 +856,13 @@ TEST(BRepGraph_DeduplicateTest, HistoryFindOriginal_TracesBackToCanonical) for (size_t aRecIdx = 0; aRecIdx < aGraph.History().NbRecords(); ++aRecIdx) { const BRepGraph_HistoryRecord& aRec = aGraph.History().Record(aRecIdx); - for (NCollection_DataMap>::Iterator + for (NCollection_DataMap>::Iterator aMapIter(aRec.Mapping); aMapIter.More(); aMapIter.Next()) { - const BRepGraph_NodeId& anOriginal = aMapIter.Key(); - const NCollection_Vector& aReplacements = aMapIter.Value(); + const BRepGraph_NodeId& anOriginal = aMapIter.Key(); + const NCollection_DynamicArray& aReplacements = aMapIter.Value(); for (int aReplIdx = 0; aReplIdx < aReplacements.Length(); ++aReplIdx) { const BRepGraph_NodeId aTraced = @@ -895,13 +895,13 @@ TEST(BRepGraph_DeduplicateTest, HistoryFindDerived_ContainsCanonicalNode) for (size_t aRecIdx = 0; aRecIdx < aGraph.History().NbRecords(); ++aRecIdx) { const BRepGraph_HistoryRecord& aRec = aGraph.History().Record(aRecIdx); - for (NCollection_DataMap>::Iterator + for (NCollection_DataMap>::Iterator aMapIter(aRec.Mapping); aMapIter.More(); aMapIter.Next()) { - const BRepGraph_NodeId& anOriginal = aMapIter.Key(); - const NCollection_Vector aDerived = + const BRepGraph_NodeId& anOriginal = aMapIter.Key(); + const NCollection_DynamicArray aDerived = aGraph.History().FindDerived(anOriginal); EXPECT_EQ(aDerived.Length(), 1); ++aNbCanonMappings; @@ -1017,8 +1017,8 @@ TEST(BRepGraph_DeduplicateTest, AfterDedup_AllInlinePCurvesHaveCurve2d) for (BRepGraph_FullEdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeId); for (int aCEIter = 0; aCEIter < aCoEdgeIdxs.Length(); ++aCEIter) { @@ -1540,12 +1540,12 @@ TEST(BRepGraph_DeduplicateTest, AnalyzeOnly_NoBackRefChangesOrNullification) ASSERT_TRUE(aGraph.IsDone()); // Snapshot surface/curve pointers before. - NCollection_Vector aSurfPtrs; + NCollection_DynamicArray aSurfPtrs; for (BRepGraph_FullFaceIterator aFaceIt(aGraph); aFaceIt.More(); aFaceIt.Next()) { aSurfPtrs.Append(BRepGraph_Tool::Face::Surface(aGraph, aFaceIt.CurrentId()).get()); } - NCollection_Vector aCurvePtrs; + NCollection_DynamicArray aCurvePtrs; for (BRepGraph_FullEdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { aCurvePtrs.Append(BRepGraph_Tool::Edge::Curve(aGraph, anEdgeIt.CurrentId()).get()); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_DeferredInvalidation_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_DeferredInvalidation_Test.cxx index cea17e83d6..de546a6070 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_DeferredInvalidation_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_DeferredInvalidation_Test.cxx @@ -61,7 +61,7 @@ TEST_F(BRepGraph_DeferredInvalidationTest, DeferredMode_PropagatesUpOnFlush) myGraph.Editor().Edges().Mut(BRepGraph_EdgeId::Start())->Tolerance = 0.5; // During deferred mode: edge is mutated, but parent wire/face are NOT yet. - const NCollection_Vector& aWires = + const NCollection_DynamicArray& aWires = myGraph.Topo().Edges().Wires(BRepGraph_EdgeId::Start()); ASSERT_GT(aWires.Length(), 0); EXPECT_EQ(myGraph.Topo().Wires().Definition(aWires.Value(0)).SubtreeGen, 0u); @@ -227,7 +227,7 @@ TEST_F(BRepGraph_DeferredInvalidationTest, EndWithoutBegin_IsIdempotent) TEST_F(BRepGraph_DeferredInvalidationTest, DeferredScope_NestedGuards_FlushOnlyOnOuterDestruction) { - const NCollection_Vector& aWires = + const NCollection_DynamicArray& aWires = myGraph.Topo().Edges().Wires(BRepGraph_EdgeId::Start()); ASSERT_GT(aWires.Length(), 0); const BRepGraph_WireId aWireId = aWires.Value(0); @@ -319,7 +319,7 @@ TEST_F(BRepGraph_DeferredInvalidationTest, EXPECT_EQ(myGraph.Topo().Products().Definition(aAssemblyId).SubtreeGen, 0u); // Find the OccurrenceRefId for the occurrence. - const NCollection_Vector& aOccRefs = + const NCollection_DynamicArray& aOccRefs = myGraph.Refs().Occurrences().IdsOf(aAssemblyId); ASSERT_EQ(aOccRefs.Length(), 1); const BRepGraph_OccurrenceRefId anOccRefId = aOccRefs.Value(0); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_DefsIterator_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_DefsIterator_Test.cxx index 0f42f959f8..e313b40187 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_DefsIterator_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_DefsIterator_Test.cxx @@ -185,7 +185,7 @@ TEST_F(BRepGraph_DefsIteratorTest, ChildOfCompound_EnumeratesHeterogeneousChildr myGraph.Editor().Vertices().Add(gp_Pnt(1.0, 2.0, 3.0), 0.01); ASSERT_TRUE(aLooseVertex.IsValid()); - NCollection_Vector aChildren; + NCollection_DynamicArray aChildren; aChildren.Append(BRepGraph_SolidId::Start()); aChildren.Append(aLooseVertex); const BRepGraph_CompoundId aCompound = myGraph.Editor().Compounds().Add(aChildren); @@ -206,7 +206,7 @@ TEST_F(BRepGraph_DefsIteratorTest, SolidOfCompSolid_EnumeratesDirectSolids) ASSERT_TRUE(aSolidA.IsValid()); ASSERT_TRUE(aSolidB.IsValid()); - NCollection_Vector aSolids; + NCollection_DynamicArray aSolids; aSolids.Append(aSolidA); aSolids.Append(aSolidB); const BRepGraph_CompSolidId aCompSolid = myGraph.Editor().CompSolids().Add(aSolids); @@ -232,7 +232,7 @@ TEST_F(BRepGraph_DefsIteratorTest, OccurrenceOfProduct_EnumeratesDirectOccurrenc TEST_F(BRepGraph_DefsIteratorTest, AuxChildrenOfShellAndSolid_EnumerateInjectedChildren) { - NCollection_Vector aShellChildren; + NCollection_DynamicArray aShellChildren; aShellChildren.Append(BRepGraph_WireId::Start()); aShellChildren.Append(BRepGraph_EdgeId::Start()); const BRepGraph_CompoundId aShellSeed = myGraph.Editor().Compounds().Add(aShellChildren); @@ -255,7 +255,7 @@ TEST_F(BRepGraph_DefsIteratorTest, AuxChildrenOfShellAndSolid_EnumerateInjectedC ASSERT_TRUE(aShellIt.More()); EXPECT_EQ(aShellIt.CurrentId().NodeKind, BRepGraph_NodeId::Kind::Edge); - NCollection_Vector aSolidChildren; + NCollection_DynamicArray aSolidChildren; aSolidChildren.Append(BRepGraph_EdgeId(1)); aSolidChildren.Append(BRepGraph_VertexId::Start()); const BRepGraph_CompoundId aSolidSeed = myGraph.Editor().Compounds().Add(aSolidChildren); @@ -281,7 +281,7 @@ TEST_F(BRepGraph_DefsIteratorTest, AuxChildrenOfShellAndSolid_EnumerateInjectedC TEST_F(BRepGraph_DefsIteratorTest, RemovedWireRef_IsSkipped) { - const NCollection_Vector& aWireRefs = + const NCollection_DynamicArray& aWireRefs = myGraph.Refs().Wires().IdsOf(BRepGraph_FaceId::Start()); ASSERT_EQ(aWireRefs.Length(), 1); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_EventBus_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_EventBus_Test.cxx index 9e74e15cc0..4bd95629e4 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_EventBus_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_EventBus_Test.cxx @@ -60,7 +60,7 @@ public: myRefImmediateEvents.Append(theRef); } - void OnRefsModified(const NCollection_Vector& theRefs, + void OnRefsModified(const NCollection_DynamicArray& theRefs, const int /*theModifiedRefKindsMask*/) noexcept override { myRefBatchEvents = theRefs; @@ -72,7 +72,7 @@ public: myImmediateEvents.Append(theNode); } - void OnNodesModified(const NCollection_Vector& theNodes) noexcept override + void OnNodesModified(const NCollection_DynamicArray& theNodes) noexcept override { myBatchEvents = theNodes; ++myBatchCallCount; @@ -141,8 +141,8 @@ public: return aCount; } - NCollection_Vector myImmediateEvents; - NCollection_Vector myBatchEvents; + NCollection_DynamicArray myImmediateEvents; + NCollection_DynamicArray myBatchEvents; int myBatchCallCount = 0; int myRemoveCallCount = 0; int myCompactCallCount = 0; @@ -150,11 +150,11 @@ public: BRepGraph_NodeId myLastReplacement; NCollection_DataMap myLastRemapMap; - NCollection_Vector myRefRemovedEvents; - NCollection_Vector myRefImmediateEvents; - NCollection_Vector myRefBatchEvents; - int myRefBatchCallCount = 0; - int myRefRemoveCallCount = 0; + NCollection_DynamicArray myRefRemovedEvents; + NCollection_DynamicArray myRefImmediateEvents; + NCollection_DynamicArray myRefBatchEvents; + int myRefBatchCallCount = 0; + int myRefRemoveCallCount = 0; DEFINE_STANDARD_RTTIEXT(BRepGraph_ModTrackingLayer, BRepGraph_Layer) diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Geometry_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Geometry_Test.cxx index 27eb8ba84b..40080c400d 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Geometry_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Geometry_Test.cxx @@ -175,8 +175,8 @@ TEST(BRepGraph_GeometryTest, Box_FindPCurve_AllEdgeFacePairs_Valid) int aPCurveCount = 0; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -198,7 +198,7 @@ TEST(BRepGraph_GeometryTest, CoEdge_FaceDefIdValid) for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (int j = 0; j < aCoEdgeIdxs.Length(); ++j) { @@ -219,7 +219,7 @@ TEST(BRepGraph_GeometryTest, CoEdge_ParamRange_NonZero) int aCoEdgeCount = 0; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (int j = 0; j < aCoEdgeIdxs.Length(); ++j) { @@ -244,7 +244,7 @@ TEST(BRepGraph_GeometryTest, CoEdge_Continuity_Valid) bool hasNonC0Continuity = false; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (int j = 0; j < aCoEdgeIdxs.Length(); ++j) { @@ -294,8 +294,8 @@ TEST(BRepGraph_GeometryTest, SameDomainFaces_SimpleBox_Empty) // For a simple box each face has a unique surface, so SameDomainFaces is empty. for (BRepGraph_FaceIterator aFaceIt(aGraph); aFaceIt.More(); aFaceIt.Next()) { - const BRepGraph_FaceId aFaceDefId = aFaceIt.CurrentId(); - const NCollection_Vector aSameDomain = + const BRepGraph_FaceId aFaceDefId = aFaceIt.CurrentId(); + const NCollection_DynamicArray aSameDomain = aGraph.Topo().Faces().SameDomain(aFaceDefId, aGraph.Allocator()); EXPECT_EQ(aSameDomain.Length(), 0) << "Face def " << aFaceDefId.Index << " has unexpected same-domain faces"; @@ -493,7 +493,7 @@ TEST(BRepGraph_GeometryTest, AllCoEdgesHaveCurve2d) int aCount = 0; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -514,7 +514,7 @@ TEST(BRepGraph_GeometryTest, CoEdgePCurveAdaptor_FallsBackOnPlaneWhenStoredPCurv BRepGraph_EdgeId anEdgeId; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); if (aCoEdges.Length() == 0) { @@ -679,7 +679,7 @@ TEST(BRepGraph_GeometryTest, Cylinder_SeamEdge_HasTwoCoEdges) bool aFoundSeam = false; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More() && !aFoundSeam; anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -708,8 +708,8 @@ TEST(BRepGraph_GeometryTest, Cylinder_SeamEdge_FindPCurve_WithOrientation) for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) @@ -742,8 +742,8 @@ TEST(BRepGraph_GeometryTest, Box_FindPCurve_MatchesToolOverload) for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) @@ -771,7 +771,7 @@ TEST(BRepGraph_GeometryTest, Cylinder_SeamEdge_FindPCurve_DistinguishesOrientati for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_History_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_History_Test.cxx index da8466fe95..b2b133bebc 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_History_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_History_Test.cxx @@ -21,7 +21,7 @@ #include "BRepGraph_RefTestTools.hxx" #include #include -#include +#include #include #include #include @@ -54,10 +54,10 @@ TEST_F(BRepGraph_HistoryTest, FindOriginal_ChainABC_ReturnsA) myGraph.Editor().Gen().ApplyModification( anEdge0, [&](BRepGraph& theGraph, - BRepGraph_NodeId /*theTarget*/) -> NCollection_Vector { + BRepGraph_NodeId /*theTarget*/) -> NCollection_DynamicArray { // Simulate producing a new edge node at index NbEdgeDefs. anEdge1 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, theGraph.Topo().Edges().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }, @@ -66,9 +66,9 @@ TEST_F(BRepGraph_HistoryTest, FindOriginal_ChainABC_ReturnsA) myGraph.Editor().Gen().ApplyModification( anEdge1, [&](BRepGraph& theGraph, - BRepGraph_NodeId /*theTarget*/) -> NCollection_Vector { + BRepGraph_NodeId /*theTarget*/) -> NCollection_DynamicArray { anEdge2 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, theGraph.Topo().Edges().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge2); return aResult; }, @@ -87,9 +87,9 @@ TEST_F(BRepGraph_HistoryTest, FindDerived_ChainABC_ContainsBAndC) myGraph.Editor().Gen().ApplyModification( anEdge0, - [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_DynamicArray { anEdge1 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, theGraph.Topo().Edges().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }, @@ -97,17 +97,18 @@ TEST_F(BRepGraph_HistoryTest, FindDerived_ChainABC_ContainsBAndC) myGraph.Editor().Gen().ApplyModification( anEdge1, - [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_DynamicArray { anEdge2 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, theGraph.Topo().Edges().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge2); return aResult; }, "Step2"); - const NCollection_Vector aDerived = myGraph.History().FindDerived(anEdge0); - bool hasEdge1 = false; - bool hasEdge2 = false; + const NCollection_DynamicArray aDerived = + myGraph.History().FindDerived(anEdge0); + bool hasEdge1 = false; + bool hasEdge2 = false; for (const BRepGraph_NodeId& aDerivedId : aDerived) { if (aDerivedId == anEdge1) @@ -130,8 +131,8 @@ TEST_F(BRepGraph_HistoryTest, FindOriginal_UnmodifiedNode_ReturnsSelf) TEST_F(BRepGraph_HistoryTest, FindDerived_UnmodifiedNode_ReturnsEmpty) { - const BRepGraph_NodeId aFace(BRepGraph_NodeId::Kind::Face, 0); - const NCollection_Vector aDerived = myGraph.History().FindDerived(aFace); + const BRepGraph_NodeId aFace(BRepGraph_NodeId::Kind::Face, 0); + const NCollection_DynamicArray aDerived = myGraph.History().FindDerived(aFace); EXPECT_EQ(aDerived.Length(), 0); } @@ -140,8 +141,8 @@ TEST_F(BRepGraph_HistoryTest, Disabled_RecordHistory_NoRecordStored) const size_t aNbBefore = myGraph.History().NbRecords(); myGraph.History().SetEnabled(false); - const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - NCollection_Vector aReplacements; + const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + NCollection_DynamicArray aReplacements; aReplacements.Append(BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, 1)); myGraph.History().Record("Disabled", anEdge0, aReplacements); @@ -156,9 +157,9 @@ TEST_F(BRepGraph_HistoryTest, Disabled_ApplyModification_ModifierStillRuns) const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); myGraph.Editor().Gen().ApplyModification( anEdge0, - [&](BRepGraph&, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph&, BRepGraph_NodeId) -> NCollection_DynamicArray { aModifierRan = true; - return NCollection_Vector(); + return NCollection_DynamicArray(); }, "DisabledOp"); @@ -173,9 +174,9 @@ TEST_F(BRepGraph_HistoryTest, ReEnabled_RecordsAfterReEnable) myGraph.History().SetEnabled(true); EXPECT_TRUE(myGraph.History().IsEnabled()); - const size_t aNbBefore = myGraph.History().NbRecords(); - const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - NCollection_Vector aReplacements; + const size_t aNbBefore = myGraph.History().NbRecords(); + const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + NCollection_DynamicArray aReplacements; aReplacements.Append(BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, 1)); myGraph.History().Record("ReEnabled", anEdge0, aReplacements); @@ -189,8 +190,8 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_EmptyReplacements) myGraph.Editor().Gen().ApplyModification( anEdge0, - [](BRepGraph&, BRepGraph_NodeId) -> NCollection_Vector { - return NCollection_Vector(); + [](BRepGraph&, BRepGraph_NodeId) -> NCollection_DynamicArray { + return NCollection_DynamicArray(); }, "Delete"); @@ -207,20 +208,21 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_MultipleReplacements) myGraph.Editor().Gen().ApplyModification( anEdge0, - [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_DynamicArray { const int aBase = theGraph.Topo().Edges().Nb(); aNew1 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, aBase); aNew2 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, aBase + 1); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(aNew1); aResult.Append(aNew2); return aResult; }, "Split"); - const NCollection_Vector aDerived = myGraph.History().FindDerived(anEdge0); - bool hasNew1 = false; - bool hasNew2 = false; + const NCollection_DynamicArray aDerived = + myGraph.History().FindDerived(anEdge0); + bool hasNew1 = false; + bool hasNew2 = false; for (const BRepGraph_NodeId& aDerivedId : aDerived) { if (aDerivedId == aNew1) @@ -234,9 +236,9 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_MultipleReplacements) TEST_F(BRepGraph_HistoryTest, RecordHistory_EmptyReplacements_Stored) { - const size_t aNbBefore = myGraph.History().NbRecords(); - const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - NCollection_Vector anEmpty; + const size_t aNbBefore = myGraph.History().NbRecords(); + const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + NCollection_DynamicArray anEmpty; myGraph.History().Record("Erase", anEdge0, anEmpty); EXPECT_EQ(myGraph.History().NbRecords(), aNbBefore + 1); @@ -248,11 +250,11 @@ TEST_F(BRepGraph_HistoryTest, HistoryRecord_SequenceNumber_Monotonic) const BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); const BRepGraph_NodeId anEdge2(BRepGraph_NodeId::Kind::Edge, 2); - NCollection_Vector aRepl; + NCollection_DynamicArray aRepl; aRepl.Append(anEdge1); myGraph.History().Record("Op1", anEdge0, aRepl); - NCollection_Vector aRepl2; + NCollection_DynamicArray aRepl2; aRepl2.Append(anEdge2); myGraph.History().Record("Op2", anEdge1, aRepl2); @@ -265,8 +267,8 @@ TEST_F(BRepGraph_HistoryTest, HistoryRecord_SequenceNumber_Monotonic) TEST_F(BRepGraph_HistoryTest, HistoryRecord_OperationName_Stored) { - const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - NCollection_Vector aRepl; + const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + NCollection_DynamicArray aRepl; aRepl.Append(BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, 1)); myGraph.History().Record("MyCustomOp", anEdge0, aRepl); @@ -278,8 +280,8 @@ TEST_F(BRepGraph_HistoryTest, NbHistoryRecords_AfterMultipleOps_Correct) { const size_t aNbBefore = myGraph.History().NbRecords(); - const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - NCollection_Vector aRepl; + const BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + NCollection_DynamicArray aRepl; aRepl.Append(BRepGraph_NodeId(BRepGraph_NodeId::Kind::Edge, 1)); myGraph.History().Record("A", anEdge0, aRepl); @@ -297,9 +299,9 @@ TEST_F(BRepGraph_HistoryTest, FindOriginal_TwoApply_TransitiveTrace) myGraph.Editor().Gen().ApplyModification( aVtx0, - [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_DynamicArray { aVtx1 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Vertex, theGraph.Topo().Vertices().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(aVtx1); return aResult; }, @@ -307,9 +309,9 @@ TEST_F(BRepGraph_HistoryTest, FindOriginal_TwoApply_TransitiveTrace) myGraph.Editor().Gen().ApplyModification( aVtx1, - [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_Vector { + [&](BRepGraph& theGraph, BRepGraph_NodeId) -> NCollection_DynamicArray { aVtx2 = BRepGraph_NodeId(BRepGraph_NodeId::Kind::Vertex, theGraph.Topo().Vertices().Nb()); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(aVtx2); return aResult; }, @@ -335,7 +337,7 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_WhenModifierThrows_DoesNotRecord #if !defined(No_Exception) EXPECT_THROW(myGraph.Editor().Gen().ApplyModification( anEdge, - [](BRepGraph&, BRepGraph_NodeId) -> NCollection_Vector { + [](BRepGraph&, BRepGraph_NodeId) -> NCollection_DynamicArray { throw Standard_Failure("Synthetic failure"); }, "ThrowingModification"), @@ -361,7 +363,8 @@ TEST_F(BRepGraph_HistoryTest, SplitEdge_RewritesAllContainingWires) ASSERT_TRUE(aSplitVertex.IsValid()); EXPECT_EQ(myGraph.Topo().Vertices().Nb(), aNbVerticesBefore + 1); - const NCollection_Vector& aWireIndices = myGraph.Topo().Edges().Wires(anEdgeId); + const NCollection_DynamicArray& aWireIndices = + myGraph.Topo().Edges().Wires(anEdgeId); ASSERT_GT(aWireIndices.Length(), 0); const uint32_t aNbEdgesBefore = myGraph.Topo().Edges().Nb(); @@ -379,7 +382,7 @@ TEST_F(BRepGraph_HistoryTest, SplitEdge_RewritesAllContainingWires) for (const BRepGraph_WireId& aWireId : aWireIndices) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, aWireId); bool hasOld = false; @@ -426,11 +429,12 @@ TEST_F(BRepGraph_HistoryTest, SplitEdge_IgnoresRemovedCoEdgeRefEntries) const BRepGraphInc::EdgeDef& anEdgeDef = myGraph.Topo().Edges().Definition(anEdgeId); const double aSplitParam = 0.5 * (anEdgeDef.ParamFirst + anEdgeDef.ParamLast); - const NCollection_Vector& aWireIndices = myGraph.Topo().Edges().Wires(anEdgeId); + const NCollection_DynamicArray& aWireIndices = + myGraph.Topo().Edges().Wires(anEdgeId); ASSERT_GT(aWireIndices.Length(), 1); - const BRepGraph_WireId aWireId = aWireIndices.Value(0); - const NCollection_Vector aWireRefsBefore = + const BRepGraph_WireId aWireId = aWireIndices.Value(0); + const NCollection_DynamicArray aWireRefsBefore = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, aWireId); ASSERT_GT(aWireRefsBefore.Length(), 0); @@ -515,7 +519,8 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_SplitEdge_RecordsBothDerivedNode myGraph.Editor().Gen().ApplyModification( anEdgeId, - [&](BRepGraph& theGraph, BRepGraph_NodeId theTarget) -> NCollection_Vector { + [&](BRepGraph& theGraph, + BRepGraph_NodeId theTarget) -> NCollection_DynamicArray { BRepGraph_EdgeId aSubA; BRepGraph_EdgeId aSubB; theGraph.Editor().Edges().Split(BRepGraph_EdgeId::FromNodeId(theTarget), @@ -524,7 +529,7 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_SplitEdge_RecordsBothDerivedNode aSubA, aSubB); - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(aSubA); aResult.Append(aSubB); return aResult; @@ -533,6 +538,7 @@ TEST_F(BRepGraph_HistoryTest, ApplyModification_SplitEdge_RecordsBothDerivedNode EXPECT_EQ(myGraph.History().NbRecords(), aNbRecordsBefore + 1); - const NCollection_Vector aDerived = myGraph.History().FindDerived(anEdgeId); + const NCollection_DynamicArray aDerived = + myGraph.History().FindDerived(anEdgeId); EXPECT_GE(aDerived.Length(), 2); } diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_MutationGen_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_MutationGen_Test.cxx index ca8a4d5ef3..d8bb249744 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_MutationGen_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_MutationGen_Test.cxx @@ -130,10 +130,10 @@ TEST_F(BRepGraph_MutationGenTest, SubtreeGen_DeferredPropagatedParent_Incremente // Store baselines before mutation. const uint32_t aEdgeOwnGenBefore = myGraph.Topo().Edges().Definition(BRepGraph_EdgeId::Start()).OwnGen; - NCollection_Vector aWireSubtreeGensBefore; + NCollection_DynamicArray aWireSubtreeGensBefore; for (BRepGraph_WireIterator aWireIt(myGraph); aWireIt.More(); aWireIt.Next()) aWireSubtreeGensBefore.Append(aWireIt.Current().SubtreeGen); - NCollection_Vector aFaceSubtreeGensBefore; + NCollection_DynamicArray aFaceSubtreeGensBefore; for (BRepGraph_FaceIterator aFaceIt(myGraph); aFaceIt.More(); aFaceIt.Next()) aFaceSubtreeGensBefore.Append(aFaceIt.Current().SubtreeGen); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_NodeId_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_NodeId_Test.cxx index c68d4223fe..e75f992ad3 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_NodeId_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_NodeId_Test.cxx @@ -63,7 +63,7 @@ TEST(BRepGraph_NodeIdTest, ImplicitConversion_PassToFunction) BRepGraph_FaceId aFace(0); // AdjacentFaces takes BRepGraph_FaceId - typed id works directly. - NCollection_Vector aAdj = + NCollection_DynamicArray aAdj = aGraph.Topo().Faces().Adjacent(aFace, aGraph.Allocator()); EXPECT_GT(aAdj.Length(), 0); } diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_ParentExplorer_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_ParentExplorer_Test.cxx index ab6ba7e7a5..36eb1fbf08 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_ParentExplorer_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_ParentExplorer_Test.cxx @@ -316,12 +316,12 @@ TEST(BRepGraph_ParentExplorerTest, CoEdgeParents_ImmediateWireIsVisible) BRepGraph_Builder::Perform(aGraph, BRepPrimAPI_MakeBox(10, 20, 30).Shape()); ASSERT_TRUE(aGraph.IsDone()); - const NCollection_Vector& aWireRefIds = + const NCollection_DynamicArray& aWireRefIds = aGraph.Refs().Wires().IdsOf(BRepGraph_FaceId::Start()); ASSERT_GT(aWireRefIds.Length(), 0); const BRepGraph_WireId aWireId = aGraph.Refs().Wires().Entry(aWireRefIds.Value(0)).WireDefId; - const NCollection_Vector& aCoEdgeRefIds = + const NCollection_DynamicArray& aCoEdgeRefIds = aGraph.Refs().CoEdges().IdsOf(aWireId); ASSERT_GT(aCoEdgeRefIds.Length(), 0); const BRepGraph_CoEdgeId aCoEdgeId = diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Polygon_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Polygon_Test.cxx index 9f520e298f..5874a123fb 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Polygon_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Polygon_Test.cxx @@ -150,7 +150,7 @@ TEST(BRepGraph_PolygonTest, PolyOnTri_Captured_AfterMesh) int aNbPolyOnTri = 0; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -163,7 +163,7 @@ TEST(BRepGraph_PolygonTest, PolyOnTri_Captured_AfterMesh) // Verify PolyOnTri entries have valid context references. for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -234,7 +234,7 @@ TEST(BRepGraph_PolygonTest, UVPoints_Captured_OnPCurves) int aNbNonOriginUV = 0; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdgeIdxs) { @@ -425,7 +425,7 @@ TEST(BRepGraph_PolygonTest, SeamEdge_PolyOnTri_TwoEntries) bool aFoundSeam = false; for (BRepGraph_EdgeIterator anEdgeIt(aGraph); anEdgeIt.More() && !aFoundSeam; anEdgeIt.Next()) { - const NCollection_Vector& aCoEdgeIdxs = + const NCollection_DynamicArray& aCoEdgeIdxs = aGraph.Topo().Edges().CoEdges(anEdgeIt.CurrentId()); // Count PolyOnTri entries per face via coedges. NCollection_DataMap aFaceCounts; diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Reconstruct_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Reconstruct_Test.cxx index f1bac29e5c..693ce82d5c 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Reconstruct_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Reconstruct_Test.cxx @@ -339,7 +339,7 @@ TEST(BRepGraph_ReconstructTest, Face_OrientationPreserved) // Verify that reconstructed faces have valid orientations matching ref entries. ASSERT_EQ(aGraph.Topo().Shells().Nb(), 1); - const NCollection_Vector aFaceRefs = + const NCollection_DynamicArray aFaceRefs = BRepGraph_TestTools::FaceRefsOfShell(aGraph, BRepGraph_ShellId::Start()); for (const BRepGraph_FaceRefId& aFaceRefId : aFaceRefs) { @@ -514,7 +514,7 @@ TEST(BRepGraph_ReconstructTest, AfterVertexMutation_ModifiedFlagAndPointChanged) BRepGraph_TestTools::OuterWireOfFace(aGraph, BRepGraph_FaceId::Start()); ASSERT_TRUE(anOuterWire.IsValid()); - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(aGraph, anOuterWire); ASSERT_GT(aCoEdgeRefs.Length(), 0); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_RefId_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_RefId_Test.cxx index 4bdd20eaca..fc0f86e883 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_RefId_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_RefId_Test.cxx @@ -482,7 +482,7 @@ TEST(BRepGraph_RefIdTest, ChildRefs_CompoundEntriesAreValid) for (BRepGraph_CompoundIterator aCompIt(aGraph); aCompIt.More(); aCompIt.Next()) { - const NCollection_Vector aChildRefs = + const NCollection_DynamicArray aChildRefs = BRepGraph_TestTools::ChildRefsOfParent(aGraph, aCompIt.CurrentId()); for (const BRepGraph_ChildRefId& aChildRefId : aChildRefs) { diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_RefTestTools.hxx b/src/ModelingData/TKBRep/GTests/BRepGraph_RefTestTools.hxx index 49f173e16d..341f00f68f 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_RefTestTools.hxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_RefTestTools.hxx @@ -22,19 +22,20 @@ #include #include -#include +#include namespace BRepGraph_TestTools { //================================================================================================= -inline NCollection_Vector CoEdgeRefsOfWire(const BRepGraph& theGraph, - const BRepGraph_WireId theWireId) +inline NCollection_DynamicArray CoEdgeRefsOfWire( + const BRepGraph& theGraph, + const BRepGraph_WireId theWireId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const BRepGraph_NodeId aParentNode = theWireId; - const int aNbCoEdgeRefs = aRefs.CoEdges().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const BRepGraph_NodeId aParentNode = theWireId; + const int aNbCoEdgeRefs = aRefs.CoEdges().Nb(); for (BRepGraph_CoEdgeRefId aRefId(0); aRefId.IsValid(aNbCoEdgeRefs); ++aRefId) { const BRepGraphInc::CoEdgeRef& aRef = aRefs.CoEdges().Entry(aRefId); @@ -53,13 +54,14 @@ inline int CountCoEdgeRefsOfWire(const BRepGraph& theGraph, const BRepGraph_Wire //================================================================================================= -inline NCollection_Vector WireRefsOfFace(const BRepGraph& theGraph, - const BRepGraph_FaceId theFaceId) +inline NCollection_DynamicArray WireRefsOfFace( + const BRepGraph& theGraph, + const BRepGraph_FaceId theFaceId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const BRepGraph_NodeId aParentNode = theFaceId; - const int aNbWireRefs = aRefs.Wires().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const BRepGraph_NodeId aParentNode = theFaceId; + const int aNbWireRefs = aRefs.Wires().Nb(); for (BRepGraph_WireRefId aRefId(0); aRefId.IsValid(aNbWireRefs); ++aRefId) { const BRepGraphInc::WireRef& aRef = aRefs.Wires().Entry(aRefId); @@ -82,8 +84,9 @@ inline bool FaceUsesWire(const BRepGraph& theGraph, const BRepGraph_FaceId theFaceId, const BRepGraph_WireId theWireId) { - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const NCollection_Vector aWireRefs = WireRefsOfFace(theGraph, theFaceId); + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const NCollection_DynamicArray aWireRefs = + WireRefsOfFace(theGraph, theFaceId); for (const BRepGraph_WireRefId& aWireRefId : aWireRefs) { if (aRefs.Wires().Entry(aWireRefId).WireDefId == theWireId) @@ -94,13 +97,14 @@ inline bool FaceUsesWire(const BRepGraph& theGraph, //================================================================================================= -inline NCollection_Vector FaceRefsOfShell(const BRepGraph& theGraph, - const BRepGraph_ShellId theShellId) +inline NCollection_DynamicArray FaceRefsOfShell( + const BRepGraph& theGraph, + const BRepGraph_ShellId theShellId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const BRepGraph_NodeId aParentNode = theShellId; - const int aNbFaceRefs = aRefs.Faces().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const BRepGraph_NodeId aParentNode = theShellId; + const int aNbFaceRefs = aRefs.Faces().Nb(); for (BRepGraph_FaceRefId aRefId(0); aRefId.IsValid(aNbFaceRefs); ++aRefId) { const BRepGraphInc::FaceRef& aRef = aRefs.Faces().Entry(aRefId); @@ -119,13 +123,14 @@ inline int CountFaceRefsOfShell(const BRepGraph& theGraph, const BRepGraph_Shell //================================================================================================= -inline NCollection_Vector ShellRefsOfSolid(const BRepGraph& theGraph, - const BRepGraph_SolidId theSolidId) +inline NCollection_DynamicArray ShellRefsOfSolid( + const BRepGraph& theGraph, + const BRepGraph_SolidId theSolidId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const BRepGraph_NodeId aParentNode = theSolidId; - const int aNbShellRefs = aRefs.Shells().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const BRepGraph_NodeId aParentNode = theSolidId; + const int aNbShellRefs = aRefs.Shells().Nb(); for (BRepGraph_ShellRefId aRefId(0); aRefId.IsValid(aNbShellRefs); ++aRefId) { const BRepGraphInc::ShellRef& aRef = aRefs.Shells().Entry(aRefId); @@ -144,14 +149,14 @@ inline int CountShellRefsOfSolid(const BRepGraph& theGraph, const BRepGraph_Soli //================================================================================================= -inline NCollection_Vector SolidRefsOfCompSolid( +inline NCollection_DynamicArray SolidRefsOfCompSolid( const BRepGraph& theGraph, const BRepGraph_CompSolidId theCompSolidId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const BRepGraph_NodeId aParentNode = theCompSolidId; - const int aNbSolidRefs = aRefs.Solids().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const BRepGraph_NodeId aParentNode = theCompSolidId; + const int aNbSolidRefs = aRefs.Solids().Nb(); for (BRepGraph_SolidRefId aRefId(0); aRefId.IsValid(aNbSolidRefs); ++aRefId) { const BRepGraphInc::SolidRef& aRef = aRefs.Solids().Entry(aRefId); @@ -171,13 +176,13 @@ inline int CountSolidRefsOfCompSolid(const BRepGraph& theGraph, //================================================================================================= -inline NCollection_Vector ChildRefsOfParent( +inline NCollection_DynamicArray ChildRefsOfParent( const BRepGraph& theGraph, const BRepGraph_NodeId theParentId) { - NCollection_Vector aRefIds; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const int aNbChildRefs = aRefs.Children().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const int aNbChildRefs = aRefs.Children().Nb(); for (BRepGraph_ChildRefId aRefId(0); aRefId.IsValid(aNbChildRefs); ++aRefId) { const BRepGraphInc::ChildRef& aRef = aRefs.Children().Entry(aRefId); @@ -203,13 +208,13 @@ inline BRepGraph_WireId OuterWireOfFace(const BRepGraph& theGraph, const BRepGra //================================================================================================= -inline NCollection_Vector CoEdgeRefsOfWire( +inline NCollection_DynamicArray CoEdgeRefsOfWire( const BRepGraphInc_Storage& theStorage, const BRepGraph_WireId theWireId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theWireId; - const int aNbCoEdgeRefs = theStorage.NbCoEdgeRefs(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theWireId; + const int aNbCoEdgeRefs = theStorage.NbCoEdgeRefs(); for (BRepGraph_CoEdgeRefId aRefId(0); aRefId.IsValid(aNbCoEdgeRefs); ++aRefId) { const BRepGraphInc::CoEdgeRef& aRef = theStorage.CoEdgeRef(aRefId); @@ -229,13 +234,13 @@ inline int CountCoEdgeRefsOfWire(const BRepGraphInc_Storage& theStorage, //================================================================================================= -inline NCollection_Vector WireRefsOfFace( +inline NCollection_DynamicArray WireRefsOfFace( const BRepGraphInc_Storage& theStorage, const BRepGraph_FaceId theFaceId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theFaceId; - const int aNbWireRefs = theStorage.NbWireRefs(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theFaceId; + const int aNbWireRefs = theStorage.NbWireRefs(); for (BRepGraph_WireRefId aRefId(0); aRefId.IsValid(aNbWireRefs); ++aRefId) { const BRepGraphInc::WireRef& aRef = theStorage.WireRef(aRefId); @@ -259,7 +264,8 @@ inline bool FaceUsesWire(const BRepGraphInc_Storage& theStorage, const BRepGraph_FaceId theFaceId, const BRepGraph_WireId theWireId) { - const NCollection_Vector aWireRefs = WireRefsOfFace(theStorage, theFaceId); + const NCollection_DynamicArray aWireRefs = + WireRefsOfFace(theStorage, theFaceId); for (const BRepGraph_WireRefId& aWireRefId : aWireRefs) { const BRepGraphInc::WireRef& aWireRef = theStorage.WireRef(aWireRefId); @@ -271,13 +277,13 @@ inline bool FaceUsesWire(const BRepGraphInc_Storage& theStorage, //================================================================================================= -inline NCollection_Vector FaceRefsOfShell( +inline NCollection_DynamicArray FaceRefsOfShell( const BRepGraphInc_Storage& theStorage, const BRepGraph_ShellId theShellId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theShellId; - const int aNbFaceRefs = theStorage.NbFaceRefs(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theShellId; + const int aNbFaceRefs = theStorage.NbFaceRefs(); for (BRepGraph_FaceRefId aRefId(0); aRefId.IsValid(aNbFaceRefs); ++aRefId) { const BRepGraphInc::FaceRef& aRef = theStorage.FaceRef(aRefId); @@ -297,13 +303,13 @@ inline int CountFaceRefsOfShell(const BRepGraphInc_Storage& theStorage, //================================================================================================= -inline NCollection_Vector ShellRefsOfSolid( +inline NCollection_DynamicArray ShellRefsOfSolid( const BRepGraphInc_Storage& theStorage, const BRepGraph_SolidId theSolidId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theSolidId; - const int aNbShellRefs = theStorage.NbShellRefs(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theSolidId; + const int aNbShellRefs = theStorage.NbShellRefs(); for (BRepGraph_ShellRefId aRefId(0); aRefId.IsValid(aNbShellRefs); ++aRefId) { const BRepGraphInc::ShellRef& aRef = theStorage.ShellRef(aRefId); @@ -323,13 +329,13 @@ inline int CountShellRefsOfSolid(const BRepGraphInc_Storage& theStorage, //================================================================================================= -inline NCollection_Vector SolidRefsOfCompSolid( +inline NCollection_DynamicArray SolidRefsOfCompSolid( const BRepGraphInc_Storage& theStorage, const BRepGraph_CompSolidId theCompSolidId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theCompSolidId; - const int aNbSolidRefs = theStorage.NbSolidRefs(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theCompSolidId; + const int aNbSolidRefs = theStorage.NbSolidRefs(); for (BRepGraph_SolidRefId aRefId(0); aRefId.IsValid(aNbSolidRefs); ++aRefId) { const BRepGraphInc::SolidRef& aRef = theStorage.SolidRef(aRefId); @@ -349,12 +355,12 @@ inline int CountSolidRefsOfCompSolid(const BRepGraphInc_Storage& theStorage, //================================================================================================= -inline NCollection_Vector ChildRefsOfParent( +inline NCollection_DynamicArray ChildRefsOfParent( const BRepGraphInc_Storage& theStorage, const BRepGraph_NodeId theParentId) { - NCollection_Vector aRefIds; - const int aNbChildRefs = theStorage.NbChildRefs(); + NCollection_DynamicArray aRefIds; + const int aNbChildRefs = theStorage.NbChildRefs(); for (BRepGraph_ChildRefId aRefId(0); aRefId.IsValid(aNbChildRefs); ++aRefId) { const BRepGraphInc::ChildRef& aRef = theStorage.ChildRef(aRefId); @@ -377,7 +383,8 @@ inline int CountChildRefsOfParent(const BRepGraphInc_Storage& theStorage, inline BRepGraph_WireId OuterWireOfFace(const BRepGraphInc_Storage& theStorage, const BRepGraph_FaceId theFaceId) { - const NCollection_Vector aWireRefs = WireRefsOfFace(theStorage, theFaceId); + const NCollection_DynamicArray aWireRefs = + WireRefsOfFace(theStorage, theFaceId); for (const BRepGraph_WireRefId& aWireRefId : aWireRefs) { const BRepGraphInc::WireRef& aWireRef = theStorage.WireRef(aWireRefId); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_RefsIterator_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_RefsIterator_Test.cxx index b5da807fc4..c96c0037db 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_RefsIterator_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_RefsIterator_Test.cxx @@ -174,7 +174,7 @@ TEST_F(BRepGraph_RefsIteratorTest, ChildOfCompound_EnumeratesChildRefs) myGraph.Editor().Vertices().Add(gp_Pnt(1.0, 2.0, 3.0), 0.01); ASSERT_TRUE(aLooseVertex.IsValid()); - NCollection_Vector aChildren; + NCollection_DynamicArray aChildren; aChildren.Append(BRepGraph_SolidId::Start()); aChildren.Append(aLooseVertex); const BRepGraph_CompoundId aCompound = myGraph.Editor().Compounds().Add(aChildren); @@ -207,7 +207,7 @@ TEST_F(BRepGraph_RefsIteratorTest, OccurrenceOfProduct_EnumeratesOccurrenceRefs) TEST_F(BRepGraph_RefsIteratorTest, AuxChildRefsOfShellAndSolid_EnumerateInjectedChildRefs) { - NCollection_Vector aShellChildren; + NCollection_DynamicArray aShellChildren; aShellChildren.Append(BRepGraph_WireId::Start()); aShellChildren.Append(BRepGraph_EdgeId::Start()); const BRepGraph_CompoundId aShellSeed = myGraph.Editor().Compounds().Add(aShellChildren); @@ -232,7 +232,7 @@ TEST_F(BRepGraph_RefsIteratorTest, AuxChildRefsOfShellAndSolid_EnumerateInjected EXPECT_EQ(myGraph.Refs().Children().Entry(aShellIt.CurrentId()).ChildDefId.NodeKind, BRepGraph_NodeId::Kind::Edge); - NCollection_Vector aSolidChildren; + NCollection_DynamicArray aSolidChildren; aSolidChildren.Append(BRepGraph_EdgeId(1)); aSolidChildren.Append(BRepGraph_VertexId::Start()); const BRepGraph_CompoundId aSolidSeed = myGraph.Editor().Compounds().Add(aSolidChildren); @@ -260,7 +260,7 @@ TEST_F(BRepGraph_RefsIteratorTest, AuxChildRefsOfShellAndSolid_EnumerateInjected TEST_F(BRepGraph_RefsIteratorTest, RemovedWireRef_IsSkipped) { - const NCollection_Vector& aWireRefs = + const NCollection_DynamicArray& aWireRefs = myGraph.Refs().Wires().IdsOf(BRepGraph_FaceId::Start()); ASSERT_EQ(aWireRefs.Length(), 1); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_RelatedIterator_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_RelatedIterator_Test.cxx index 381c902944..17221963ac 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_RelatedIterator_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_RelatedIterator_Test.cxx @@ -148,7 +148,7 @@ TEST_F(BRepGraph_RelatedIteratorTest, EdgeReferencedByFace_RemovedFaceIsSkipped) const BRepGraph_EdgeId anEdgeId(0); // Find the two faces that reference this edge. - const NCollection_Vector& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); + const NCollection_DynamicArray& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); ASSERT_EQ(aFaces.Length(), 2); // Remove the first face. @@ -262,8 +262,8 @@ TEST_F(BRepGraph_RelatedIteratorTest, EdgeOfBox_AllRelationsSequential) const BRepGraph_EdgeId anEdgeId(0); const BRepGraph_NodeId anEdgeNode(anEdgeId); - NCollection_Vector aFaces; - NCollection_Vector aVertices; + NCollection_DynamicArray aFaces; + NCollection_DynamicArray aVertices; for (BRepGraph_RelatedIterator anIt(myGraph, anEdgeNode); anIt.More(); anIt.Next()) { @@ -296,7 +296,8 @@ TEST_F(BRepGraph_RelatedIteratorTest, EdgeOfBox_RemovedFace_CorrectTransition) const BRepGraph_NodeId anEdgeNode(anEdgeId); // Remove one parent face. - const NCollection_Vector& aParentFaces = myGraph.Topo().Edges().Faces(anEdgeId); + const NCollection_DynamicArray& aParentFaces = + myGraph.Topo().Edges().Faces(anEdgeId); ASSERT_EQ(aParentFaces.Length(), 2); myGraph.Editor().Gen().RemoveNode(aParentFaces.Value(0)); @@ -315,7 +316,7 @@ TEST_F(BRepGraph_RelatedIteratorTest, VertexOfBox_AllParentEdgesYielded) const BRepGraph_VertexId aVertexId(0); const BRepGraph_NodeId aVertexNode(aVertexId); - NCollection_Vector anEdges; + NCollection_DynamicArray anEdges; for (BRepGraph_RelatedIterator anIt(myGraph, aVertexNode); anIt.More(); anIt.Next()) { if (anIt.CurrentRelation() == BRepGraph_RelatedIterator::RelationKind::IncidentEdge) diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_ReplaceVertex_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_ReplaceVertex_Test.cxx index 1fb6cb2fcd..f9ba999eeb 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_ReplaceVertex_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_ReplaceVertex_Test.cxx @@ -173,7 +173,7 @@ TEST(BRepGraph_ReplaceVertexTest, ReverseIndex_Rebuilt_VertexToEdge) ASSERT_TRUE(aGraph.Editor().Edges().ReplaceVertex(anEdgeId, anOldRefId, aNewVertex).IsValid()); // New vertex must now see anEdgeId in its vertex-to-edge reverse map. - const NCollection_Vector& aNewEdges = + const NCollection_DynamicArray& aNewEdges = aGraph.Topo().Vertices().Edges(aNewVertex); bool aFoundNew = false; for (const BRepGraph_EdgeId& anE : aNewEdges) @@ -188,7 +188,7 @@ TEST(BRepGraph_ReplaceVertexTest, ReverseIndex_Rebuilt_VertexToEdge) // Old vertex may still be referenced by other edges of the box (shared // corners); but it should no longer see anEdgeId through this slot. - const NCollection_Vector& aOldEdges = + const NCollection_DynamicArray& aOldEdges = aGraph.Topo().Vertices().Edges(aOldVertexId); (void)aOldEdges; diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_ReverseIterator_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_ReverseIterator_Test.cxx index 480bcd91e6..2fb99cc993 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_ReverseIterator_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_ReverseIterator_Test.cxx @@ -100,8 +100,8 @@ TEST_F(BRepGraph_ReverseIteratorTest, WiresOfEdge_BoxEdgeBelongsToTwoWires) TEST_F(BRepGraph_ReverseIteratorTest, SequentialIteration_SkipsRemovedParent) { - const BRepGraph_EdgeId anEdgeId(0); - const NCollection_Vector& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); + const BRepGraph_EdgeId anEdgeId(0); + const NCollection_DynamicArray& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); ASSERT_EQ(aFaces.Length(), 2); // Remove one parent face. @@ -113,8 +113,8 @@ TEST_F(BRepGraph_ReverseIteratorTest, SequentialIteration_SkipsRemovedParent) TEST_F(BRepGraph_ReverseIteratorTest, IndexedAccess_DoesNotSkipRemoved) { - const BRepGraph_EdgeId anEdgeId(0); - const NCollection_Vector& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); + const BRepGraph_EdgeId anEdgeId(0); + const NCollection_DynamicArray& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); ASSERT_EQ(aFaces.Length(), 2); myGraph.Editor().Gen().RemoveNode(aFaces.Value(0)); @@ -210,8 +210,9 @@ TEST_F(BRepGraph_ReverseIteratorTest, Definition_ReturnsEdgeDefinition) TEST_F(BRepGraph_ReverseIteratorTest, SkipsRemovedParent_EdgesOfVertex) { - const BRepGraph_VertexId aVertexId(0); - const NCollection_Vector& anEdges = myGraph.Topo().Vertices().Edges(aVertexId); + const BRepGraph_VertexId aVertexId(0); + const NCollection_DynamicArray& anEdges = + myGraph.Topo().Vertices().Edges(aVertexId); // Box vertex touches 3 edges. ASSERT_EQ(anEdges.Length(), 3); @@ -223,8 +224,8 @@ TEST_F(BRepGraph_ReverseIteratorTest, SkipsRemovedParent_EdgesOfVertex) TEST_F(BRepGraph_ReverseIteratorTest, SkipsRemovedParent_AllRemoved) { - const BRepGraph_EdgeId anEdgeId(0); - const NCollection_Vector& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); + const BRepGraph_EdgeId anEdgeId(0); + const NCollection_DynamicArray& aFaces = myGraph.Topo().Edges().Faces(anEdgeId); ASSERT_EQ(aFaces.Length(), 2); myGraph.Editor().Gen().RemoveNode(aFaces.Value(0)); @@ -236,8 +237,9 @@ TEST_F(BRepGraph_ReverseIteratorTest, SkipsRemovedParent_AllRemoved) TEST_F(BRepGraph_ReverseIteratorTest, StartingIndex_SkipsToPosition) { - const BRepGraph_VertexId aVertexId(0); - const NCollection_Vector& anEdges = myGraph.Topo().Vertices().Edges(aVertexId); + const BRepGraph_VertexId aVertexId(0); + const NCollection_DynamicArray& anEdges = + myGraph.Topo().Vertices().Edges(aVertexId); ASSERT_EQ(anEdges.Length(), 3); // Start at index 1 - should yield only edges at index >= 1. diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_ScenarioMatrix_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_ScenarioMatrix_Test.cxx index 6c5aa59507..0ad96c2bf2 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_ScenarioMatrix_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_ScenarioMatrix_Test.cxx @@ -206,7 +206,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdge_MutationAndBothSubsystemsConsis for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges) && !aSeamEdgeId.IsValid(); ++anEdgeId) { - const NCollection_Vector* aCoEdges = + const NCollection_DynamicArray* aCoEdges = aOrigStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdges == nullptr) continue; @@ -259,7 +259,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdge_MutationAndBothSubsystemsConsis const int aNbEdges = aReconStorage.NbEdges(); for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aNbEdges) && !aSeamFound; ++anEdgeId) { - const NCollection_Vector* aCoEdges = + const NCollection_DynamicArray* aCoEdges = aReconStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdges == nullptr) continue; @@ -316,7 +316,7 @@ TEST(BRepGraph_ScenarioMatrix, CompSolid_TwoBoxes_BothSubsystemsMutateReconstruc aSolidId.IsValid(aOrigStorage.NbSolids()); ++aSolidId) { - const NCollection_Vector* aCSVec = + const NCollection_DynamicArray* aCSVec = aOrigStorage.ReverseIndex().CompSolidsOfSolid(aSolidId); EXPECT_NE(aCSVec, nullptr) << "Solid " << aSolidId.Index << " not in any CompSolid"; } @@ -494,7 +494,7 @@ TEST(BRepGraph_ScenarioMatrix, Compound_FreeWireFreeEdgeFreeVertex_ValidateAndPo // Wire must be reverse-indexed into the compound. { - const NCollection_Vector* aCmpOfWire = + const NCollection_DynamicArray* aCmpOfWire = aStorage.ReverseIndex().CompoundsOfWire(BRepGraph_WireId::Start()); EXPECT_NE(aCmpOfWire, nullptr) << "Free wire must appear in CompoundsOfWire reverse index"; if (aCmpOfWire != nullptr) @@ -508,7 +508,7 @@ TEST(BRepGraph_ScenarioMatrix, Compound_FreeWireFreeEdgeFreeVertex_ValidateAndPo bool aFoundEdgeInCompound = false; for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aStorage.NbEdges()); ++anEdgeId) { - const NCollection_Vector* aCmpOfEdge = + const NCollection_DynamicArray* aCmpOfEdge = aStorage.ReverseIndex().CompoundsOfEdge(anEdgeId); if (aCmpOfEdge != nullptr && aCmpOfEdge->Length() > 0) { @@ -526,7 +526,7 @@ TEST(BRepGraph_ScenarioMatrix, Compound_FreeWireFreeEdgeFreeVertex_ValidateAndPo ASSERT_EQ(aFreeVtxNode->NodeKind, BRepGraph_NodeId::Kind::Vertex); const BRepGraph_VertexId aFreeVtxId(aFreeVtxNode->Index); - const NCollection_Vector* aCmpOfFreeVtx = + const NCollection_DynamicArray* aCmpOfFreeVtx = aStorage.ReverseIndex().CompoundsOfVertex(aFreeVtxId); EXPECT_NE(aCmpOfFreeVtx, nullptr) << "Free vertex must appear in CompoundsOfVertex reverse index"; if (aCmpOfFreeVtx != nullptr) @@ -574,7 +574,7 @@ TEST(BRepGraph_ScenarioMatrix, Compound_BoxAndCylinder_MutationReconstructAreaRe int aBaseSeamCount = 0; for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aBaseStorage.NbEdges()); ++anEdgeId) { - const NCollection_Vector* aCoEdges = + const NCollection_DynamicArray* aCoEdges = aBaseStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdges == nullptr) continue; @@ -636,7 +636,7 @@ TEST(BRepGraph_ScenarioMatrix, Compound_BoxAndCylinder_MutationReconstructAreaRe int aReconSeamCount = 0; for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aReconStorage.NbEdges()); ++anEdgeId) { - const NCollection_Vector* aCoEdges = + const NCollection_DynamicArray* aCoEdges = aReconStorage.ReverseIndex().CoEdgesOfEdge(anEdgeId); if (aCoEdges == nullptr) continue; @@ -898,19 +898,19 @@ TEST(BRepGraph_ScenarioMatrix, Compound_MixedAtomicChildren_ReverseIndexCoverage const BRepGraphInc_ReverseIndex& aRev = aStorage.ReverseIndex(); if (aStorage.NbSolids() > 0) { - const NCollection_Vector* aParents = + const NCollection_DynamicArray* aParents = aRev.CompoundsOfSolid(BRepGraph_SolidId::Start()); EXPECT_TRUE(aParents == nullptr || aParents->Length() >= 0); } if (aStorage.NbEdges() > 0) { - const NCollection_Vector* aParents = + const NCollection_DynamicArray* aParents = aRev.CompoundsOfEdge(BRepGraph_EdgeId::Start()); (void)aParents; } if (aStorage.NbVertices() > 0) { - const NCollection_Vector* aParents = + const NCollection_DynamicArray* aParents = aRev.CompoundsOfVertex(BRepGraph_VertexId::Start()); (void)aParents; } @@ -947,7 +947,7 @@ TEST(BRepGraph_ScenarioMatrix, CompSolid_ThreeBoxes_ReverseIndexPerSolid) for (BRepGraph_SolidId aSolidId(0); aSolidId.IsValid(aStorage.NbSolids()); ++aSolidId) { - const NCollection_Vector* aParents = + const NCollection_DynamicArray* aParents = aStorage.ReverseIndex().CompSolidsOfSolid(aSolidId); ASSERT_NE(aParents, nullptr) << "Solid " << aSolidId.Index << " missing from CompSolid reverse index"; @@ -1091,7 +1091,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdgeSplit_AuditStable) BRepGraph_EdgeId aSeamEdgeId; for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aGraph.Topo().Edges().Nb()); ++anEdgeId) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { @@ -1130,7 +1130,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdgeSplit_AuditStable) // Every seam-paired coedge on the live sub-edges must still be bidirectional. auto checkBidirectionalOnEdge = [&](const BRepGraph_EdgeId theEdgeId) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(theEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { @@ -1164,7 +1164,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdgeSplit_CoEdgeFaceIncidence) BRepGraph_EdgeId aSeamEdgeId; for (BRepGraph_EdgeId anEdgeId(0); anEdgeId.IsValid(aGraph.Topo().Edges().Nb()); ++anEdgeId) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(anEdgeId); for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) { @@ -1190,7 +1190,7 @@ TEST(BRepGraph_ScenarioMatrix, Cylinder_SeamEdgeSplit_CoEdgeFaceIncidence) ASSERT_TRUE(aSubB.IsValid()); auto checkCoEdgeIncidence = [&](const BRepGraph_EdgeId theSubId) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = aGraph.Topo().Edges().CoEdges(theSubId); ASSERT_GT(aCoEdges.Length(), 0) << "Sub-edge must carry at least one CoEdge"; for (const BRepGraph_CoEdgeId& aCoEdgeId : aCoEdges) diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Sharing_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Sharing_Test.cxx index e98113a53d..2f1043225f 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Sharing_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Sharing_Test.cxx @@ -160,8 +160,8 @@ TEST_F(BRepGraph_SharingTest, SharedEdge_IncidenceRefs_DifferentOrientation) int aMultiFaceEdgeCount = 0; for (BRepGraph_EdgeIterator anEdgeIt(myGraph); anEdgeIt.More(); anEdgeIt.Next()) { - const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); - const NCollection_Vector& aCoEdgeIdxs = + const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); + const NCollection_DynamicArray& aCoEdgeIdxs = myGraph.Topo().Edges().CoEdges(anEdgeId); if (aCoEdgeIdxs.Length() < 2) continue; @@ -247,7 +247,7 @@ TEST_F(BRepGraph_SharingTest, CompoundTwoIdenticalBoxes) EXPECT_EQ(aGraph.Topo().Vertices().Nb(), 8); // Compound has 2 child references to the same solid. - const NCollection_Vector aChildRefs = + const NCollection_DynamicArray aChildRefs = BRepGraph_TestTools::ChildRefsOfParent(aGraph, BRepGraph_CompoundId::Start()); ASSERT_EQ(aChildRefs.Length(), 2); EXPECT_EQ(aGraph.Refs().Children().Entry(aChildRefs.Value(0)).ChildDefId.Index, diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Test.cxx index 20810b5b7f..d4b87143c5 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Test.cxx @@ -102,9 +102,9 @@ static int componentKey(const BRepGraph_NodeId theNode) return theNode.Index * BRepGraph_NodeId::THE_KIND_COUNT + static_cast(theNode.NodeKind); } -static NCollection_Vector collectFreeEdges(const BRepGraph& theGraph) +static NCollection_DynamicArray collectFreeEdges(const BRepGraph& theGraph) { - NCollection_Vector aResult(16); + NCollection_DynamicArray aResult(16); for (BRepGraph_EdgeIterator anEdgeIt(theGraph); anEdgeIt.More(); anEdgeIt.Next()) { const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); @@ -166,22 +166,22 @@ static int countFaceComponents(const BRepGraph& theGraph) struct ReverseIndexInputData { - NCollection_Vector Vertices; - NCollection_Vector Edges; - NCollection_Vector CoEdges; - NCollection_Vector Wires; - NCollection_Vector Faces; - NCollection_Vector Shells; - NCollection_Vector Solids; - NCollection_Vector Compounds; - NCollection_Vector CompSolids; - NCollection_Vector ShellRefs; - NCollection_Vector FaceRefs; - NCollection_Vector WireRefs; - NCollection_Vector CoEdgeRefs; - NCollection_Vector SolidRefs; - NCollection_Vector ChildRefs; - NCollection_Vector VertexRefs; + NCollection_DynamicArray Vertices; + NCollection_DynamicArray Edges; + NCollection_DynamicArray CoEdges; + NCollection_DynamicArray Wires; + NCollection_DynamicArray Faces; + NCollection_DynamicArray Shells; + NCollection_DynamicArray Solids; + NCollection_DynamicArray Compounds; + NCollection_DynamicArray CompSolids; + NCollection_DynamicArray ShellRefs; + NCollection_DynamicArray FaceRefs; + NCollection_DynamicArray WireRefs; + NCollection_DynamicArray CoEdgeRefs; + NCollection_DynamicArray SolidRefs; + NCollection_DynamicArray ChildRefs; + NCollection_DynamicArray VertexRefs; }; static ReverseIndexInputData buildReverseIndexBaseInput() @@ -449,7 +449,7 @@ static void verifyBuildDeltaScenario(const occ::handle* aBaseWires = + const NCollection_DynamicArray* aBaseWires = aRevIdx.WiresOfEdge(BRepGraph_EdgeId::Start()); ASSERT_NE(aBaseWires, nullptr); ASSERT_EQ(aBaseWires->Length(), 1); @@ -510,61 +510,61 @@ static void verifyBuildDeltaScenario(const occ::handle* aActiveWires = + const NCollection_DynamicArray* aActiveWires = aRevIdx.WiresOfEdge(BRepGraph_EdgeId(1)); ASSERT_NE(aActiveWires, nullptr); ASSERT_EQ(aActiveWires->Length(), 1); EXPECT_EQ(aActiveWires->Value(0), BRepGraph_WireId(1)); - const NCollection_Vector* aActiveFaces = + const NCollection_DynamicArray* aActiveFaces = aRevIdx.FacesOfWire(BRepGraph_WireId(1)); ASSERT_NE(aActiveFaces, nullptr); ASSERT_EQ(aActiveFaces->Length(), 1); EXPECT_EQ(aActiveFaces->Value(0), BRepGraph_FaceId(1)); - const NCollection_Vector* anActiveShells = + const NCollection_DynamicArray* anActiveShells = aRevIdx.ShellsOfFace(BRepGraph_FaceId(1)); ASSERT_NE(anActiveShells, nullptr); ASSERT_EQ(anActiveShells->Length(), 1); EXPECT_EQ(anActiveShells->Value(0), BRepGraph_ShellId(1)); - const NCollection_Vector* anActiveSolids = + const NCollection_DynamicArray* anActiveSolids = aRevIdx.SolidsOfShell(BRepGraph_ShellId(1)); ASSERT_NE(anActiveSolids, nullptr); ASSERT_EQ(anActiveSolids->Length(), 1); EXPECT_EQ(anActiveSolids->Value(0), BRepGraph_SolidId(1)); - const NCollection_Vector* aCompoundsOfSolid = + const NCollection_DynamicArray* aCompoundsOfSolid = aRevIdx.CompoundsOfSolid(BRepGraph_SolidId(1)); ASSERT_NE(aCompoundsOfSolid, nullptr); ASSERT_EQ(aCompoundsOfSolid->Length(), 1); EXPECT_EQ(aCompoundsOfSolid->Value(0), BRepGraph_CompoundId::Start()); - const NCollection_Vector* aCompoundsOfShell = + const NCollection_DynamicArray* aCompoundsOfShell = aRevIdx.CompoundsOfShell(BRepGraph_ShellId(1)); ASSERT_NE(aCompoundsOfShell, nullptr); ASSERT_EQ(aCompoundsOfShell->Length(), 1); EXPECT_EQ(aCompoundsOfShell->Value(0), BRepGraph_CompoundId(1)); - const NCollection_Vector* aCompoundsOfFace = + const NCollection_DynamicArray* aCompoundsOfFace = aRevIdx.CompoundsOfFace(BRepGraph_FaceId(1)); ASSERT_NE(aCompoundsOfFace, nullptr); ASSERT_EQ(aCompoundsOfFace->Length(), 1); EXPECT_EQ(aCompoundsOfFace->Value(0), BRepGraph_CompoundId(2)); - const NCollection_Vector* aCompoundsOfCompound = + const NCollection_DynamicArray* aCompoundsOfCompound = aRevIdx.CompoundsOfCompound(BRepGraph_CompoundId::Start()); ASSERT_NE(aCompoundsOfCompound, nullptr); ASSERT_EQ(aCompoundsOfCompound->Length(), 1); EXPECT_EQ(aCompoundsOfCompound->Value(0), BRepGraph_CompoundId(3)); - const NCollection_Vector* aCompSolidsOfSolid = + const NCollection_DynamicArray* aCompSolidsOfSolid = aRevIdx.CompSolidsOfSolid(BRepGraph_SolidId(1)); ASSERT_NE(aCompSolidsOfSolid, nullptr); ASSERT_EQ(aCompSolidsOfSolid->Length(), 1); EXPECT_EQ(aCompSolidsOfSolid->Value(0), BRepGraph_CompSolidId::Start()); - const NCollection_Vector* aCompoundsOfCompSolid = + const NCollection_DynamicArray* aCompoundsOfCompSolid = aRevIdx.CompoundsOfCompSolid(BRepGraph_CompSolidId::Start()); ASSERT_NE(aCompoundsOfCompSolid, nullptr); ASSERT_EQ(aCompoundsOfCompSolid->Length(), 1); @@ -620,7 +620,7 @@ TEST_F(BRepGraphTest, FaceCountMatchesFacesVector_AfterBindUnbindSequence) auto expectCountsMatch = [&]() { for (int anEdgeIdx = 0; anEdgeIdx < aData.Edges.Length(); ++anEdgeIdx) { - const NCollection_Vector* aFaces = + const NCollection_DynamicArray* aFaces = aRevIdx.FacesOfEdge(BRepGraph_EdgeId(anEdgeIdx)); const int aExpectedCount = (aFaces == nullptr) ? 0 : aFaces->Length(); EXPECT_EQ(aRevIdx.NbFacesOfEdge(BRepGraph_EdgeId(anEdgeIdx)), aExpectedCount) @@ -846,13 +846,13 @@ TEST_F(BRepGraphTest, BuildDelta_IndexesNewRefsOnExistingCompoundAndCompSolid) anOldNbChildRefs, anOldNbSolidRefs); - const NCollection_Vector* aCompoundsOfSolid = + const NCollection_DynamicArray* aCompoundsOfSolid = aRevIdx.CompoundsOfSolid(BRepGraph_SolidId::Start()); ASSERT_NE(aCompoundsOfSolid, nullptr); EXPECT_EQ(aCompoundsOfSolid->Length(), 1); EXPECT_EQ(aCompoundsOfSolid->Value(0), BRepGraph_CompoundId::Start()); - const NCollection_Vector* aCompSolidsOfSolid = + const NCollection_DynamicArray* aCompSolidsOfSolid = aRevIdx.CompSolidsOfSolid(BRepGraph_SolidId::Start()); ASSERT_NE(aCompSolidsOfSolid, nullptr); EXPECT_EQ(aCompSolidsOfSolid->Length(), 1); @@ -923,19 +923,19 @@ TEST_F(BRepGraphTest, ReverseIndex_CompoundOfAtomicKinds_WireEdgeVertex) aData.ChildRefs, aData.VertexRefs); - const NCollection_Vector* aCompoundsOfWire = + const NCollection_DynamicArray* aCompoundsOfWire = aRevIdx.CompoundsOfWire(BRepGraph_WireId::Start()); ASSERT_NE(aCompoundsOfWire, nullptr); EXPECT_EQ(aCompoundsOfWire->Length(), 1); EXPECT_EQ(aCompoundsOfWire->Value(0), BRepGraph_CompoundId::Start()); - const NCollection_Vector* aCompoundsOfEdge = + const NCollection_DynamicArray* aCompoundsOfEdge = aRevIdx.CompoundsOfEdge(BRepGraph_EdgeId::Start()); ASSERT_NE(aCompoundsOfEdge, nullptr); EXPECT_EQ(aCompoundsOfEdge->Length(), 1); EXPECT_EQ(aCompoundsOfEdge->Value(0), BRepGraph_CompoundId::Start()); - const NCollection_Vector* aCompoundsOfVertex = + const NCollection_DynamicArray* aCompoundsOfVertex = aRevIdx.CompoundsOfVertex(BRepGraph_VertexId(2)); ASSERT_NE(aCompoundsOfVertex, nullptr); EXPECT_EQ(aCompoundsOfVertex->Length(), 1); @@ -1044,7 +1044,7 @@ TEST_F(BRepGraphTest, FindPCurve_ValidPair) BRepGraph_TestTools::OuterWireOfFace(myGraph, aFaceIt.CurrentId()); if (!anOuterWire.IsValid()) continue; - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, anOuterWire); for (const BRepGraph_CoEdgeRefId& aCoEdgeRefId : aCoEdgeRefs) { @@ -1095,8 +1095,8 @@ TEST_F(BRepGraphTest, SameDomainFaces_Box_Empty) { for (BRepGraph_FaceIterator aFaceIt(myGraph); aFaceIt.More(); aFaceIt.Next()) { - BRepGraph_FaceId aFaceId = aFaceIt.CurrentId(); - NCollection_Vector aSameDomain = + BRepGraph_FaceId aFaceId = aFaceIt.CurrentId(); + NCollection_DynamicArray aSameDomain = myGraph.Topo().Faces().SameDomain(aFaceId, myGraph.Allocator()); EXPECT_EQ(aSameDomain.Length(), 0) << "Box face " << aFaceId.Index << " should have no same-domain faces"; @@ -1181,7 +1181,7 @@ TEST_F(BRepGraphTest, ReBuild_UIDMonotonic) TEST_F(BRepGraphTest, DetectMissingPCurves_ValidBox_Empty) { - NCollection_Vector> aMissing(16); + NCollection_DynamicArray> aMissing(16); for (BRepGraph_FaceIterator aFaceIt(myGraph); aFaceIt.More(); aFaceIt.Next()) { const BRepGraph_FaceId aFaceId = aFaceIt.CurrentId(); @@ -1207,7 +1207,7 @@ TEST_F(BRepGraphTest, DetectMissingPCurves_ValidBox_Empty) TEST_F(BRepGraphTest, DetectDegenerateWires_ValidBox_Empty) { - NCollection_Vector aDegenerate(16); + NCollection_DynamicArray aDegenerate(16); for (BRepGraph_WireIterator aWireIt(myGraph); aWireIt.More(); aWireIt.Next()) { const BRepGraph_WireId aWireId = aWireIt.CurrentId(); @@ -1273,16 +1273,16 @@ TEST_F(BRepGraphTest, NbFacesOfEdge_SharedEdge) TEST_F(BRepGraphTest, FreeEdges_ClosedBox_Empty) { - NCollection_Vector aFree = collectFreeEdges(myGraph); + NCollection_DynamicArray aFree = collectFreeEdges(myGraph); EXPECT_EQ(aFree.Length(), 0); } TEST_F(BRepGraphTest, RecordHistory_BasicEntry) { - size_t aBefore = myGraph.History().NbRecords(); - BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); - NCollection_Vector aRepl; + size_t aBefore = myGraph.History().NbRecords(); + BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); + NCollection_DynamicArray aRepl; aRepl.Append(anEdge1); myGraph.History().Record("TestOp", anEdge0, aRepl); EXPECT_EQ(myGraph.History().NbRecords(), aBefore + 1); @@ -1292,7 +1292,7 @@ TEST_F(BRepGraphTest, RecordHistory_BasicEntry) TEST_F(BRepGraphTest, ReplaceEdge_Substitution) { // Get the first wire and its first edge via incidence refs. - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); const BRepGraphInc::CoEdgeRef& aOldCR = myGraph.Refs().CoEdges().Entry(aCoEdgeRefs.Value(0)); @@ -1306,7 +1306,7 @@ TEST_F(BRepGraphTest, ReplaceEdge_Substitution) myGraph.Editor().Wires().ReplaceEdge(BRepGraph_WireId::Start(), anOldEdgeId, aNewEdgeId, false); // Verify the substitution via the updated incidence refs. - const NCollection_Vector aCoEdgeRefsAfter = + const NCollection_DynamicArray aCoEdgeRefsAfter = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefsAfter.Length(), 1); const BRepGraphInc::CoEdgeRef& aNewCR = myGraph.Refs().CoEdges().Entry(aCoEdgeRefsAfter.Value(0)); @@ -1402,7 +1402,7 @@ TEST_F(BRepGraphTest, ReconstructFace_EachBoxFace_SameSubShapeCounts) TEST_F(BRepGraphTest, ReconstructFace_AfterEdgeReplace_ContainsNewEdge) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); const BRepGraphInc::CoEdgeRef& aCR0 = myGraph.Refs().CoEdges().Entry(aCoEdgeRefs.Value(0)); @@ -1482,7 +1482,7 @@ TEST_F(BRepGraphTest, Shape_Unmodified_ReturnsSameShape) TEST_F(BRepGraphTest, Shape_AfterReplaceEdge_DiffersFromOriginal) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); const BRepGraphInc::CoEdgeRef& aCR0 = myGraph.Refs().CoEdges().Entry(aCoEdgeRefs.Value(0)); @@ -1547,7 +1547,7 @@ TEST_F(BRepGraphTest, OwnGen_MutableEdge_PropagatesSubtreeGenUp) if (BRepGraph_EdgeId::Start().IsValid(myGraph.Topo().Edges().Nb())) { // Find a wire containing this edge. - const NCollection_Vector& aWires = + const NCollection_DynamicArray& aWires = myGraph.Topo().Edges().Wires(BRepGraph_EdgeId::Start()); if (aWires.Length() > 0) { @@ -1695,9 +1695,9 @@ TEST_F(BRepGraphTest, RecordHistory_MultipleRecords_SequenceNumbers) { const size_t aBefore = myGraph.History().NbRecords(); - BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); - NCollection_Vector aRepl; + BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); + NCollection_DynamicArray aRepl; aRepl.Append(anEdge1); myGraph.History().Record("OpA", anEdge0, aRepl); @@ -1725,7 +1725,7 @@ TEST_F(BRepGraphTest, FindOriginal_SingleHop_ReturnsSource) BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); auto aModifier = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }; @@ -1742,15 +1742,15 @@ TEST_F(BRepGraphTest, FindDerived_SingleHop_ContainsTarget) BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); auto aModifier = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }; myGraph.Editor().Gen().ApplyModification(anEdge0, aModifier, "TestHop"); - NCollection_Vector aDerived = myGraph.History().FindDerived(anEdge0); - bool isFound = false; + NCollection_DynamicArray aDerived = myGraph.History().FindDerived(anEdge0); + bool isFound = false; for (const BRepGraph_NodeId& aDerivedId : aDerived) { if (aDerivedId == anEdge1) @@ -1770,7 +1770,7 @@ TEST_F(BRepGraphTest, ApplyModification_MultiStepChain_FindOriginalTracesBack) // Step 1: edge0 -> edge1 auto aModifier1 = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }; @@ -1778,7 +1778,7 @@ TEST_F(BRepGraphTest, ApplyModification_MultiStepChain_FindOriginalTracesBack) // Step 2: edge1 -> edge2 auto aModifier2 = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge2); return aResult; }; @@ -1790,8 +1790,8 @@ TEST_F(BRepGraphTest, ApplyModification_MultiStepChain_FindOriginalTracesBack) // FindDerived from edge0 returns leaf-only transitive descendants. // edge1 is an intermediate (it has further derived edge2), so only edge2 is returned. - NCollection_Vector aDerived = myGraph.History().FindDerived(anEdge0); - bool isEdge2Found = false; + NCollection_DynamicArray aDerived = myGraph.History().FindDerived(anEdge0); + bool isEdge2Found = false; for (const BRepGraph_NodeId& aDerivedId : aDerived) { if (aDerivedId == anEdge2) @@ -1800,8 +1800,8 @@ TEST_F(BRepGraphTest, ApplyModification_MultiStepChain_FindOriginalTracesBack) EXPECT_TRUE(isEdge2Found) << "Edge2 not found in FindDerived(Edge0)"; // edge1 can be found by querying FindDerived on the intermediate step. - NCollection_Vector aDerived1 = myGraph.History().FindDerived(anEdge1); - bool isEdge2FromEdge1 = false; + NCollection_DynamicArray aDerived1 = myGraph.History().FindDerived(anEdge1); + bool isEdge2FromEdge1 = false; for (const BRepGraph_NodeId& aDerivedId : aDerived1) { if (aDerivedId == anEdge2) @@ -1833,7 +1833,7 @@ TEST_F(BRepGraphTest, AddPCurve_NewPCurve_RetrievableViaFindPCurve) TEST_F(BRepGraphTest, ReplaceEdge_Reversed_OrientationFlipped) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); @@ -1849,7 +1849,7 @@ TEST_F(BRepGraphTest, ReplaceEdge_Reversed_OrientationFlipped) myGraph.Editor().Wires().ReplaceEdge(BRepGraph_WireId::Start(), anOldEdgeId, aNewEdgeId, true); - const NCollection_Vector aCoEdgeRefsAfter = + const NCollection_DynamicArray aCoEdgeRefsAfter = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefsAfter.Length(), 1); const BRepGraphInc::CoEdgeRef& aNewCR = myGraph.Refs().CoEdges().Entry(aCoEdgeRefsAfter.Value(0)); @@ -1865,7 +1865,7 @@ TEST_F(BRepGraphTest, ReplaceEdge_Reversed_OrientationFlipped) TEST_F(BRepGraphTest, ReplaceEdge_UpdatesEdgeToCoEdgeReverseIndex) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); @@ -1875,7 +1875,7 @@ TEST_F(BRepGraphTest, ReplaceEdge_UpdatesEdgeToCoEdgeReverseIndex) const BRepGraph_EdgeId aNewEdgeId((anOldEdgeId.Index + 1) % myGraph.Topo().Edges().Nb()); auto hasCoEdge = [&](const BRepGraph_EdgeId theEdgeId) { - const NCollection_Vector& aCoEdges = + const NCollection_DynamicArray& aCoEdges = myGraph.Topo().Edges().CoEdges(theEdgeId); for (const BRepGraph_CoEdgeId& aCoEdge : aCoEdges) { @@ -1897,7 +1897,7 @@ TEST_F(BRepGraphTest, ReplaceEdge_UpdatesEdgeToCoEdgeReverseIndex) TEST_F(BRepGraphTest, RemoveCoEdge_PrunesOrphanAndKeepsReverseIndexConsistent) { - const NCollection_Vector aCoEdgeRefsBefore = + const NCollection_DynamicArray aCoEdgeRefsBefore = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefsBefore.Length(), 1); @@ -1908,7 +1908,7 @@ TEST_F(BRepGraphTest, RemoveCoEdge_PrunesOrphanAndKeepsReverseIndexConsistent) ASSERT_TRUE(myGraph.Editor().Wires().RemoveCoEdge(BRepGraph_WireId::Start(), aCoEdgeRefId)); - const NCollection_Vector aCoEdgeRefsAfter = + const NCollection_DynamicArray aCoEdgeRefsAfter = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); EXPECT_EQ(aCoEdgeRefsAfter.Length(), aCoEdgeRefsBefore.Length() - 1); EXPECT_TRUE(myGraph.Topo().CoEdges().Definition(aCoEdgeId).IsRemoved); @@ -1927,12 +1927,12 @@ TEST_F(BRepGraphTest, RemoveCoEdge_PrunesOrphanAndKeepsReverseIndexConsistent) TEST_F(BRepGraphTest, RemoveChild_PreservesSharedChildAndRebuildsReverseIndex) { - NCollection_Vector aChildren; + NCollection_DynamicArray aChildren; aChildren.Append(BRepGraph_NodeId(BRepGraph_SolidId::Start())); const BRepGraph_CompoundId aCompoundId = myGraph.Editor().Compounds().Add(aChildren); ASSERT_TRUE(aCompoundId.IsValid()); - const NCollection_Vector aChildRefsBefore = + const NCollection_DynamicArray aChildRefsBefore = BRepGraph_TestTools::ChildRefsOfParent(myGraph, BRepGraph_NodeId(aCompoundId)); ASSERT_EQ(aChildRefsBefore.Length(), 1); @@ -1984,7 +1984,7 @@ TEST_F(BRepGraphTest, RemoveChild_RemovesAuxChildUsageFromSolid) TEST_F(BRepGraphTest, RemoveFace_PrunesOrphanAndRebuildsReverseIndex) { - const NCollection_Vector aFaceRefsBefore = + const NCollection_DynamicArray aFaceRefsBefore = BRepGraph_TestTools::FaceRefsOfShell(myGraph, BRepGraph_ShellId::Start()); ASSERT_GE(aFaceRefsBefore.Length(), 1); @@ -2013,7 +2013,7 @@ TEST_F(BRepGraphTest, RemoveFace_PrunesOrphanAndRebuildsReverseIndex) TEST_F(BRepGraphTest, RemoveShell_PrunesOrphanAndRebuildsReverseIndex) { - const NCollection_Vector aShellRefsBefore = + const NCollection_DynamicArray aShellRefsBefore = BRepGraph_TestTools::ShellRefsOfSolid(myGraph, BRepGraph_SolidId::Start()); ASSERT_GE(aShellRefsBefore.Length(), 1); @@ -2047,8 +2047,8 @@ TEST_F(BRepGraphTest, RemoveWire_PrunesOrphanAndRebuildsReverseIndex) bool isFound = false; for (BRepGraph_FaceIterator aFaceIt(myGraph); aFaceIt.More() && !isFound; aFaceIt.Next()) { - const BRepGraph_FaceId aCandidateFaceId = aFaceIt.CurrentId(); - const NCollection_Vector aWireRefs = + const BRepGraph_FaceId aCandidateFaceId = aFaceIt.CurrentId(); + const NCollection_DynamicArray aWireRefs = BRepGraph_TestTools::WireRefsOfFace(myGraph, aCandidateFaceId); for (const BRepGraph_WireRefId& aCandidateWireRefId : aWireRefs) { @@ -2105,7 +2105,7 @@ TEST_F(BRepGraphTest, RemoveOccurrence_PrunesOccurrenceSubtreeAndRebuildsReverse myGraph.Editor().Products().AddOccurrence(aAssemblyId, aPartId, TopLoc_Location()); ASSERT_TRUE(anOccId.IsValid()); - const NCollection_Vector& aOccurrenceRefsBefore = + const NCollection_DynamicArray& aOccurrenceRefsBefore = myGraph.Refs().Occurrences().IdsOf(aAssemblyId); ASSERT_EQ(aOccurrenceRefsBefore.Length(), 1); const BRepGraph_OccurrenceRefId anOccurrenceRefId = aOccurrenceRefsBefore.Value(0); @@ -2189,7 +2189,7 @@ TEST_F(BRepGraphTest, RemoveVertex_ClearsBoundarySlotAndPrunesUniqueVertex) TEST_F(BRepGraphTest, RemoveNode_EdgeWithReplacement_ReparentsAllCoEdges) { - const NCollection_Vector aCoEdgeRefs = + const NCollection_DynamicArray aCoEdgeRefs = BRepGraph_TestTools::CoEdgeRefsOfWire(myGraph, BRepGraph_WireId::Start()); ASSERT_GE(aCoEdgeRefs.Length(), 1); @@ -2200,11 +2200,11 @@ TEST_F(BRepGraphTest, RemoveNode_EdgeWithReplacement_ReparentsAllCoEdges) myGraph.Editor().Gen().RemoveNode(anOldEdgeId, aNewEdgeId); - const NCollection_Vector& anOldCoEdges = + const NCollection_DynamicArray& anOldCoEdges = myGraph.Topo().Edges().CoEdges(anOldEdgeId); EXPECT_EQ(anOldCoEdges.Length(), 0); - const NCollection_Vector& aNewCoEdges = + const NCollection_DynamicArray& aNewCoEdges = myGraph.Topo().Edges().CoEdges(aNewEdgeId); EXPECT_GT(aNewCoEdges.Length(), 0); for (const BRepGraph_CoEdgeId& aNewCoEdgeId : aNewCoEdges) @@ -2257,7 +2257,7 @@ TEST_F(BRepGraphTest, FreeEdges_SingleFace_AllEdgesFree) BRepGraph_Builder::Perform(aGraph, aFace); ASSERT_TRUE(aGraph.IsDone()); - NCollection_Vector aFreeEdges = collectFreeEdges(aGraph); + NCollection_DynamicArray aFreeEdges = collectFreeEdges(aGraph); EXPECT_EQ(aFreeEdges.Length(), 4); } @@ -2317,8 +2317,8 @@ TEST_F(BRepGraphTest, DetectToleranceConflicts_ManualConflict_Detected) if (isConflictSetUp) { - NCollection_Vector aConflicts(16); - NCollection_Map aConflictKeys; + NCollection_DynamicArray aConflicts(16); + NCollection_Map aConflictKeys; for (BRepGraph_EdgeIterator anEdgeIt(myGraph); anEdgeIt.More(); anEdgeIt.Next()) { const BRepGraph_EdgeId anEdgeId = anEdgeIt.CurrentId(); @@ -2331,7 +2331,7 @@ TEST_F(BRepGraphTest, DetectToleranceConflicts_ManualConflict_Detected) const occ::handle& aCurve = BRepGraph_Tool::Edge::Curve(myGraph, anEdgeId); double aMinTol = myGraph.Topo().Edges().Definition(anEdgeId).Tolerance; double aMaxTol = aMinTol; - NCollection_Vector aCurveEdges(4); + NCollection_DynamicArray aCurveEdges(4); aCurveEdges.Append(anEdgeId); for (BRepGraph_EdgeIterator anOtherIt(myGraph); anOtherIt.More(); anOtherIt.Next()) { @@ -2484,7 +2484,7 @@ TEST_F(BRepGraphTest, Face_InnerWireRefs_BoxHasNone) // Box faces have no holes, so non-outer WireRefs should be empty. for (BRepGraph_FaceIterator aFaceIt(myGraph); aFaceIt.More(); aFaceIt.Next()) { - const NCollection_Vector aWireRefs = + const NCollection_DynamicArray aWireRefs = BRepGraph_TestTools::WireRefsOfFace(myGraph, aFaceIt.CurrentId()); int aNonOuterCount = 0; for (const BRepGraph_WireRefId& aWireRefId : aWireRefs) @@ -2501,7 +2501,7 @@ TEST_F(BRepGraphTest, Face_Orientation_ValidValue) { // Verify face orientations in the shell's incidence refs. ASSERT_EQ(myGraph.Topo().Shells().Nb(), 1); - const NCollection_Vector aFaceRefs = + const NCollection_DynamicArray aFaceRefs = BRepGraph_TestTools::FaceRefsOfShell(myGraph, BRepGraph_ShellId::Start()); for (int aRefIdx = 0; aRefIdx < aFaceRefs.Length(); ++aRefIdx) { @@ -2785,9 +2785,9 @@ TEST_F(BRepGraphTest, RecordHistory_Disabled_NoRecordAdded) myGraph.History().SetEnabled(false); - BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); - NCollection_Vector aRepl; + BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); + NCollection_DynamicArray aRepl; aRepl.Append(anEdge1); myGraph.History().Record("ShouldNotRecord", anEdge0, aRepl); @@ -2800,9 +2800,9 @@ TEST_F(BRepGraphTest, RecordHistory_ReEnabled_RecordsAgain) const size_t aBefore = myGraph.History().NbRecords(); - BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); - BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); - NCollection_Vector aRepl; + BRepGraph_NodeId anEdge0(BRepGraph_NodeId::Kind::Edge, 0); + BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); + NCollection_DynamicArray aRepl; aRepl.Append(anEdge1); myGraph.History().Record("Skipped", anEdge0, aRepl); EXPECT_EQ(myGraph.History().NbRecords(), aBefore); @@ -2823,7 +2823,7 @@ TEST_F(BRepGraphTest, ApplyModification_HistoryDisabled_NoHistoryNoDerivedEdges) BRepGraph_NodeId anEdge1(BRepGraph_NodeId::Kind::Edge, 1); auto aModifier = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge1); return aResult; }; @@ -2843,7 +2843,7 @@ TEST_F(BRepGraphTest, ApplyModification_HistoryDisabled_ModifierStillRuns) auto aModifier = [&](BRepGraph& /*theGraph*/, BRepGraph_NodeId /*theTarget*/) { isModifierCalled = true; - NCollection_Vector aResult; + NCollection_DynamicArray aResult; aResult.Append(anEdge0); return aResult; }; diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Validate_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Validate_Test.cxx index 10bd47d618..0580cc440f 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Validate_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Validate_Test.cxx @@ -46,13 +46,13 @@ namespace //================================================================================================= -NCollection_Vector coEdgeRefsOfWire(const BRepGraph& theGraph, - const BRepGraph_WireId theWireId) +NCollection_DynamicArray coEdgeRefsOfWire(const BRepGraph& theGraph, + const BRepGraph_WireId theWireId) { - NCollection_Vector aRefIds; - const BRepGraph_NodeId aParentNode = theWireId; - const BRepGraph::RefsView& aRefs = theGraph.Refs(); - const int aNbCoEdgeRefs = aRefs.CoEdges().Nb(); + NCollection_DynamicArray aRefIds; + const BRepGraph_NodeId aParentNode = theWireId; + const BRepGraph::RefsView& aRefs = theGraph.Refs(); + const int aNbCoEdgeRefs = aRefs.CoEdges().Nb(); for (BRepGraph_CoEdgeRefId aRefId(0); aRefId.IsValid(aNbCoEdgeRefs); ++aRefId) { const BRepGraphInc::CoEdgeRef& aRef = aRefs.CoEdges().Entry(aRefId); @@ -179,7 +179,7 @@ TEST(BRepGraph_ValidateTest, WireConnectivity_DisconnectedEdges) ASSERT_TRUE(aTargetWire.IsValid()); // Get the first edge in the wire and corrupt its end vertex. - const NCollection_Vector aWireRefIds = + const NCollection_DynamicArray aWireRefIds = coEdgeRefsOfWire(aGraph, aTargetWire); ASSERT_GE(aWireRefIds.Length(), 1); const BRepGraphInc::CoEdgeRef& aFirstCR = aGraph.Refs().CoEdges().Entry(aWireRefIds.Value(0)); @@ -392,12 +392,13 @@ TEST(BRepGraph_ValidateTest, Audit_ValidatesCoEdgeUIDsFromBuilderWireCreation) ASSERT_TRUE(aGraph.IsDone()); ASSERT_GT(aGraph.Topo().Edges().Nb(), 0); - NCollection_Vector> anEdges; + NCollection_DynamicArray> anEdges; anEdges.Append(std::make_pair(BRepGraph_EdgeId::Start(), TopAbs_FORWARD)); const BRepGraph_WireId aWireId = aGraph.Editor().Wires().Add(anEdges); ASSERT_TRUE(aWireId.IsValid()); - const NCollection_Vector aWireRefIds = coEdgeRefsOfWire(aGraph, aWireId); + const NCollection_DynamicArray aWireRefIds = + coEdgeRefsOfWire(aGraph, aWireId); ASSERT_EQ(aWireRefIds.Length(), 1); const BRepGraph_NodeId aCoEdgeId = BRepGraph_CoEdgeId(aGraph.Refs().CoEdges().Entry(aWireRefIds.Value(0)).CoEdgeDefId.Index); diff --git a/src/ModelingData/TKBRep/GTests/BRepGraph_Views_Test.cxx b/src/ModelingData/TKBRep/GTests/BRepGraph_Views_Test.cxx index 5205cd8c0c..2b03efa424 100644 --- a/src/ModelingData/TKBRep/GTests/BRepGraph_Views_Test.cxx +++ b/src/ModelingData/TKBRep/GTests/BRepGraph_Views_Test.cxx @@ -52,8 +52,8 @@ const occ::handle& testUserAttrKind() } template -static int countActiveRefs(const NCollection_Vector& theRefIds, - const theRefFn& theRefAccess) +static int countActiveRefs(const NCollection_DynamicArray& theRefIds, + const theRefFn& theRefAccess) { int aCount = 0; for (const theRefIdType& aRefId : theRefIds) @@ -231,7 +231,8 @@ TEST_F(BRepGraph_ViewsTest, DefsView_RepIdConvenienceAccessors_RoundTrip) EXPECT_EQ(myGraph.Topo().Edges().Curve3DRepId(anEdgeId), myGraph.Topo().Edges().Definition(anEdgeId).Curve3DRepId); - const NCollection_Vector& aCoEdges = myGraph.Topo().Edges().CoEdges(anEdgeId); + const NCollection_DynamicArray& aCoEdges = + myGraph.Topo().Edges().CoEdges(anEdgeId); ASSERT_GT(aCoEdges.Length(), 0); const BRepGraph_CoEdgeId aCoEdgeId = aCoEdges.Value(0); EXPECT_EQ(myGraph.Topo().CoEdges().Curve2DRepId(aCoEdgeId), @@ -274,9 +275,9 @@ TEST_F(BRepGraph_ViewsTest, UIDsView_NodeIdFrom_RoundTrip) TEST_F(BRepGraph_ViewsTest, UIDsView_NodeIdFrom_MultipleRoundTrip) { - NCollection_Vector aUIDs; - const BRepGraph_UID aFaceUID = myGraph.UIDs().Of(BRepGraph_FaceId::Start()); - const BRepGraph_UID anEdgeUID = myGraph.UIDs().Of(BRepGraph_EdgeId::Start()); + NCollection_DynamicArray aUIDs; + const BRepGraph_UID aFaceUID = myGraph.UIDs().Of(BRepGraph_FaceId::Start()); + const BRepGraph_UID anEdgeUID = myGraph.UIDs().Of(BRepGraph_EdgeId::Start()); ASSERT_TRUE(aFaceUID.IsValid()); ASSERT_TRUE(anEdgeUID.IsValid()); @@ -290,7 +291,7 @@ TEST_F(BRepGraph_ViewsTest, UIDsView_NodeIdFrom_MultipleRoundTrip) TEST_F(BRepGraph_ViewsTest, UIDsView_NodeIdFrom_InvalidAndWrongGeneration) { - NCollection_Vector aUIDs; + NCollection_DynamicArray aUIDs; aUIDs.Append(BRepGraph_UID()); aUIDs.Append(BRepGraph_UID(BRepGraph_NodeId::Kind::Face, 1, myGraph.UIDs().Generation() + 1)); @@ -326,7 +327,7 @@ TEST_F(BRepGraph_ViewsTest, UIDsView_Of_RemovedNode_ReturnsInvalid) TEST_F(BRepGraph_ViewsTest, UIDsView_RefLookup_RemovedRef_ReturnsInvalidAndHasFalse) { - const NCollection_Vector& aFaceRefs = + const NCollection_DynamicArray& aFaceRefs = myGraph.Refs().Faces().IdsOf(BRepGraph_ShellId::Start()); ASSERT_GT(aFaceRefs.Length(), 0); const BRepGraph_FaceRefId aFaceRefId = aFaceRefs.Value(0); @@ -344,7 +345,7 @@ TEST_F(BRepGraph_ViewsTest, UIDsView_RefLookup_RemovedRef_ReturnsInvalidAndHasFa TEST_F(BRepGraph_ViewsTest, UIDsView_Of_RemovedRef_ReturnsInvalid) { - const NCollection_Vector& aFaceRefs = + const NCollection_DynamicArray& aFaceRefs = myGraph.Refs().Faces().IdsOf(BRepGraph_ShellId::Start()); ASSERT_GT(aFaceRefs.Length(), 0); const BRepGraph_FaceRefId aFaceRefId = aFaceRefs.Value(0); @@ -366,16 +367,17 @@ TEST_F(BRepGraph_ViewsTest, UIDsView_Of_OutOfRangeRef_ReturnsInvalid) TEST_F(BRepGraph_ViewsTest, SpatialView_AdjacentFaces_FourPerBoxFace) { - BRepGraph_FaceId aFaceId(0); - NCollection_Vector aResult = + BRepGraph_FaceId aFaceId(0); + NCollection_DynamicArray aResult = myGraph.Topo().Faces().Adjacent(aFaceId, myGraph.Allocator()); EXPECT_EQ(aResult.Length(), 4); } TEST_F(BRepGraph_ViewsTest, SpatialView_FacesOfEdge_TwoPerBoxEdge) { - BRepGraph_EdgeId anEdgeId(0); - const NCollection_Vector& aResult = myGraph.Topo().Edges().Faces(anEdgeId); + BRepGraph_EdgeId anEdgeId(0); + const NCollection_DynamicArray& aResult = + myGraph.Topo().Edges().Faces(anEdgeId); EXPECT_EQ(aResult.Length(), 2); } @@ -386,11 +388,11 @@ TEST_F(BRepGraph_ViewsTest, SpatialView_OutParam_Parity) const BRepGraph_VertexId aVertexId(0); const occ::handle& anAllocator = myGraph.Allocator(); - const NCollection_Vector aAdjacentByValue = + const NCollection_DynamicArray aAdjacentByValue = myGraph.Topo().Faces().Adjacent(aFaceId, anAllocator); EXPECT_EQ(aAdjacentByValue.Length(), 4); - const NCollection_Vector anAdjEdgesByValue = + const NCollection_DynamicArray anAdjEdgesByValue = myGraph.Topo().Edges().Adjacent(anEdgeId, anAllocator); EXPECT_GE(anAdjEdgesByValue.Length(), 4); } @@ -475,7 +477,7 @@ TEST_F(BRepGraph_ViewsTest, TopoView_GroupedProductAndOccurrenceOps_Parity) EXPECT_EQ(myGraph.Topo().Occurrences().Product(aPartOccurrence), aPartProduct); EXPECT_EQ(myGraph.Topo().Occurrences().ParentProduct(aPartOccurrence), aSubAssembly); - const NCollection_Vector& aOccurrenceRefs = + const NCollection_DynamicArray& aOccurrenceRefs = myGraph.Refs().Occurrences().IdsOf(aSubAssembly); ASSERT_EQ(aOccurrenceRefs.Length(), 1); { @@ -491,12 +493,12 @@ TEST_F(BRepGraph_ViewsTest, SpatialView_OutParam_ClearAndInvalid) { const occ::handle& anAllocator = myGraph.Allocator(); - const NCollection_Vector aFaceResult = + const NCollection_DynamicArray aFaceResult = myGraph.Topo().Faces().Adjacent(BRepGraph_FaceId::Start(), anAllocator); EXPECT_EQ(aFaceResult.Length(), 4); EXPECT_EQ(myGraph.Topo().Faces().Adjacent(BRepGraph_FaceId(999), anAllocator).Length(), 0); - const NCollection_Vector anAdjEdgeResult = + const NCollection_DynamicArray anAdjEdgeResult = myGraph.Topo().Edges().Adjacent(BRepGraph_EdgeId::Start(), anAllocator); EXPECT_GE(anAdjEdgeResult.Length(), 4); EXPECT_EQ(myGraph.Topo().Edges().Adjacent(BRepGraph_EdgeId(999), anAllocator).Length(), 0); @@ -619,7 +621,7 @@ TEST_F(BRepGraph_ViewsTest, EdgeOps_FindCoEdgeId_ValidPair) (void)anEdgeDef; // Use reverse index to get a face for this edge. - const NCollection_Vector& aFaces = myGraph.Topo().Edges().Faces(anEdge); + const NCollection_DynamicArray& aFaces = myGraph.Topo().Edges().Faces(anEdge); ASSERT_GT(aFaces.Length(), 0); const BRepGraph_FaceId aFace = aFaces.Value(0); @@ -636,8 +638,9 @@ TEST_F(BRepGraph_ViewsTest, EdgeOps_FindCoEdgeId_InvalidPair_ReturnsInvalid) { // Use a valid edge but a face that doesn't share it. // Edge 0 and the last face are very unlikely to share a coedge in a box. - const BRepGraph_EdgeId anEdge(0); - const NCollection_Vector& aEdgeFaces = myGraph.Topo().Edges().Faces(anEdge); + const BRepGraph_EdgeId anEdge(0); + const NCollection_DynamicArray& aEdgeFaces = + myGraph.Topo().Edges().Faces(anEdge); // Find a face NOT adjacent to edge 0. BRepGraph_FaceId aNonAdjacentFace; @@ -779,8 +782,9 @@ TEST_F(BRepGraph_ViewsTest, RefsView_RefIdsOf_MatchFreshBuild) TEST_F(BRepGraph_ViewsTest, RefsView_FaceRefIdsOf_LocalFilteringHandlesRemoved) { - const BRepGraph_ShellId aShellId(0); - const NCollection_Vector& aFaceRefs = myGraph.Refs().Faces().IdsOf(aShellId); + const BRepGraph_ShellId aShellId(0); + const NCollection_DynamicArray& aFaceRefs = + myGraph.Refs().Faces().IdsOf(aShellId); ASSERT_GT(aFaceRefs.Length(), 0); { @@ -814,7 +818,7 @@ TEST_F(BRepGraph_ViewsTest, RefsView_VertexRefIdsOfEdge_ContainsBoundaryVertices TEST_F(BRepGraph_ViewsTest, RefsView_GenericRefHelpers_RoundTripForTypedRef) { - const NCollection_Vector& aFaceRefs = + const NCollection_DynamicArray& aFaceRefs = myGraph.Refs().Faces().IdsOf(BRepGraph_ShellId::Start()); ASSERT_GT(aFaceRefs.Length(), 0); @@ -873,7 +877,7 @@ TEST_F(BRepGraph_ViewsTest, RefsView_GenericRefHelpers_OccurrenceDefaults) .AddOccurrence(anAssembly, aPartProduct, TopLoc_Location(aTrsf)) .IsValid()); - const NCollection_Vector& anOccurrenceRefs = + const NCollection_DynamicArray& anOccurrenceRefs = myGraph.Refs().Occurrences().IdsOf(anAssembly); ASSERT_EQ(anOccurrenceRefs.Length(), 1); @@ -893,7 +897,7 @@ TEST_F(BRepGraph_ViewsTest, RefsView_GenericRefHelpers_InvalidAndRemoved) EXPECT_EQ(myGraph.Refs().Orientation(BRepGraph_RefId()), TopAbs_FORWARD); EXPECT_TRUE(myGraph.Refs().IsRemoved(BRepGraph_RefId())); - const NCollection_Vector& aFaceRefs = + const NCollection_DynamicArray& aFaceRefs = myGraph.Refs().Faces().IdsOf(BRepGraph_ShellId::Start()); ASSERT_GT(aFaceRefs.Length(), 0); const BRepGraph_FaceRefId aFaceRefId = aFaceRefs.Value(0); @@ -1014,7 +1018,7 @@ TEST_F(BRepGraph_ViewsTest, MutView_RemovedNode_ThrowsProgramError) TEST_F(BRepGraph_ViewsTest, MutView_RemovedRef_ThrowsProgramError) { - const NCollection_Vector& aFaceRefs = + const NCollection_DynamicArray& aFaceRefs = myGraph.Refs().Faces().IdsOf(BRepGraph_ShellId::Start()); ASSERT_GT(aFaceRefs.Length(), 0); const BRepGraph_FaceRefId aFaceRefId = aFaceRefs.Value(0); @@ -1082,7 +1086,8 @@ TEST_F(BRepGraph_ViewsTest, EditorView_RemoveRep_CurveAndPCurve_HideCurveQueries EXPECT_FALSE(BRepGraph_Tool::Edge::HasCurve(myGraph, anEdgeId)); EXPECT_TRUE(BRepGraph_Tool::Edge::Curve(myGraph, anEdgeId).IsNull()); - const NCollection_Vector& aCoEdges = myGraph.Topo().Edges().CoEdges(anEdgeId); + const NCollection_DynamicArray& aCoEdges = + myGraph.Topo().Edges().CoEdges(anEdgeId); ASSERT_GT(aCoEdges.Length(), 0); const BRepGraph_CoEdgeId aCoEdgeId = aCoEdges.Value(0); const BRepGraph_Curve2DRepId aCurve2DRepId = myGraph.Topo().CoEdges().Curve2DRepId(aCoEdgeId); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GGenExtCC.hxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GGenExtCC.hxx index aa55e8272d..ca91fdd579 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GGenExtCC.hxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GGenExtCC.hxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -629,7 +629,7 @@ void Extrema_GGenExtCC aFilter(aCellSize); - NCollection_Vector aPnts; + NCollection_DynamicArray aPnts; int i, j, k; math_Vector aFirstBorderInterval(1, 2); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx index 7913278f8c..4e4f11b733 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx @@ -321,9 +321,9 @@ inline static void fillParams(const NCollection_Array1& theKnots occ::handle>& theParams, int theSample) { - NCollection_Vector aParams; - int i = 1; - double aPrevPar = theParMin; + NCollection_DynamicArray aParams; + int i = 1; + double aPrevPar = theParMin; aParams.Append(aPrevPar); // calculation the array of parametric points depending on the knots array variation and degree of // given surface diff --git a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC.hxx b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC.hxx index 6db1ec56c7..9db9f00bc0 100644 --- a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC.hxx +++ b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC.hxx @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -145,8 +145,8 @@ struct ExtremumResult //! Non-copyable to enforce use of const reference from Perform(). struct Result { - ExtremaPC::Status Status = ExtremaPC::Status::NotDone; //!< Computation status - NCollection_Vector Extrema{8}; //!< Collection of found extrema + ExtremaPC::Status Status = ExtremaPC::Status::NotDone; //!< Computation status + NCollection_DynamicArray Extrema{8}; //!< Collection of found extrema //! For infinite solutions, stores the constant squared distance. //! Only meaningful when Status == Status::InfiniteSolutions. diff --git a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_BSplineCurve.cxx b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_BSplineCurve.cxx index 39aad558d0..547b1f2290 100644 --- a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_BSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_BSplineCurve.cxx @@ -15,7 +15,7 @@ #include #include -#include +#include //================================================================================================== @@ -60,7 +60,7 @@ math_Vector ExtremaPC_BSplineCurve::buildKnotAwareParams() const const int aSamplesPerSpan = ExtremaPC::THE_BSPLINE_SPAN_MULTIPLIER * (aDegree + 1); // Single-pass algorithm using dynamic vector - NCollection_Vector aParams; + NCollection_DynamicArray aParams; aParams.Append(theUMin); for (int i = aKnots.Lower(); i < aKnots.Upper(); ++i) diff --git a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_GridEvaluator.hxx b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_GridEvaluator.hxx index 91ac4322e6..beb0d8942b 100644 --- a/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_GridEvaluator.hxx +++ b/src/ModelingData/TKGeomBase/ExtremaPC/ExtremaPC_GridEvaluator.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -496,11 +496,12 @@ private: NCollection_Array1 myGrid; //!< Cached grid // Mutable cached temporaries (reused via Clear()) - mutable ExtremaPC::Result myResult; //!< Reusable result - mutable NCollection_Vector myCandidates; //!< Candidates from grid scan - mutable NCollection_Vector myFoundRoots; //!< Found roots for dedup - mutable NCollection_Vector> mySortedIndices; //!< Sorted candidate indices - mutable NCollection_Array1 myProcessed; //!< Processed flags for grid scan + mutable ExtremaPC::Result myResult; //!< Reusable result + mutable NCollection_DynamicArray myCandidates; //!< Candidates from grid scan + mutable NCollection_DynamicArray myFoundRoots; //!< Found roots for dedup + mutable NCollection_DynamicArray> + mySortedIndices; //!< Sorted candidate indices + mutable NCollection_Array1 myProcessed; //!< Processed flags for grid scan }; #endif // _ExtremaPC_GridEvaluator_HeaderFile diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx index 2b368e3932..ee8e48eacd 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #define FuncTol 1.e-10 @@ -83,7 +83,7 @@ struct SplitDS { SplitDS(const occ::handle& theCurve, const occ::handle& theSurface, - NCollection_Vector& theSplits) + NCollection_DynamicArray& theSplits) : myCurve(theCurve), mySurface(theSurface), mySplits(theSplits), @@ -98,7 +98,7 @@ struct SplitDS const occ::handle myCurve; const occ::handle mySurface; - NCollection_Vector& mySplits; + NCollection_DynamicArray& mySplits; double myPerMinParam; double myPerMaxParam; @@ -119,7 +119,7 @@ static void BuildCurveSplits(const occ::handle& theCurve, const occ::handle& theSurface, const double theTolU, const double theTolV, - NCollection_Vector& theSplits); + NCollection_DynamicArray& theSplits); //! Perform splitting on a specified direction. Sub-method in BuildCurveSplits. static void SplitOnDirection(SplitDS& theSplitDS); @@ -640,7 +640,7 @@ occ::handle ProjLib_CompProjectedCurve::ShallowCopy() const void ProjLib_CompProjectedCurve::Init() { myTabInt.Nullify(); - NCollection_Vector aSplits; + NCollection_DynamicArray aSplits; aSplits.Clear(); double Tol; // Tolerance for ExactBound @@ -2109,7 +2109,7 @@ void BuildCurveSplits(const occ::handle& theCurve, const occ::handle& theSurface, const double theTolU, const double theTolV, - NCollection_Vector& theSplits) + NCollection_DynamicArray& theSplits) { SplitDS aDS(theCurve, theSurface, theSplits); diff --git a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ViewerSelector.cxx b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ViewerSelector.cxx index d659da730f..0804ca8c1a 100644 --- a/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ViewerSelector.cxx +++ b/src/Visualization/TKIVtk/IVtkOCC/IVtkOCC_ViewerSelector.cxx @@ -201,7 +201,7 @@ void IVtkOCC_ViewerSelector::Pick(double** thePoly, void IVtkOCC_ViewerSelector::Activate(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -222,7 +222,7 @@ void IVtkOCC_ViewerSelector::Activate(const occ::handle& th //============================================================================ void IVtkOCC_ViewerSelector::Deactivate(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.hxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.hxx index b2b2cefd53..eba4d553e1 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.hxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_CommonSensitiveEntity.hxx @@ -87,7 +87,7 @@ private: private: occ::handle myDataSource; //!< mesh data source - NCollection_Vector myItemIndexes; //!< indices for BVH tree reordering + NCollection_DynamicArray myItemIndexes; //!< indices for BVH tree reordering MeshVS_MeshSelectionMethod mySelMethod; //!< selection mode // clang-format off int myMaxFaceNodes; //!< maximum nodes within the element in mesh diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx index 151a8371ab..6b3f4f5c8e 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_MeshPrsBuilder.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -745,7 +745,7 @@ void MeshVS_MeshPrsBuilder::AddFaceWirePrs( CalculateCenter(theCoords, theNbNodes, aCenterX, aCenterY, aCenterZ); } - NCollection_Vector aNodes(theNbNodes); + NCollection_DynamicArray aNodes(theNbNodes); for (int aNodeIdx = 0; aNodeIdx < theNbNodes; ++aNodeIdx) { @@ -807,7 +807,7 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs( CalculateCenter(theCoords, theNbNodes, aCenterX, aCenterY, aCenterZ); } - NCollection_Vector aVertexNormals(theMaxNodes); + NCollection_DynamicArray aVertexNormals(theMaxNodes); if (theIsShaded) { @@ -828,7 +828,7 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs( } } - NCollection_Vector aNodes(theMaxNodes); + NCollection_DynamicArray aNodes(theMaxNodes); for (int aNodeIdx = 0; aNodeIdx < theNbNodes; ++aNodeIdx) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.cxx index 2051eed7c8..5b4cb258dc 100755 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.cxx @@ -59,7 +59,7 @@ void OpenGl_Clipping::Reset(const occ::handle& t myCappedSubPlane = 0; myCappedChain.Nullify(); - // Method ::add() implicitly extends myDisabledPlanes (NCollection_Vector::SetValue()), + // Method ::add() implicitly extends myDisabledPlanes (NCollection_DynamicArray::SetValue()), // however we do not reset myDisabledPlanes and mySkipFilter beforehand to avoid redundant memory // re-allocations. So once extended, they will never reduce their size to lower values. This // should not be a problem since overall number of clipping planes is expected to be quite small. diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.hxx index 8b7287f387..47e8899fb8 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Clipping.hxx @@ -17,7 +17,7 @@ #define OpenGl_Clipping_HeaderFile #include -#include +#include #include class OpenGl_ClippingIterator; @@ -146,7 +146,7 @@ protected: //! @name clipping state modification commands private: occ::handle myPlanesGlobal; //!< global clipping planes occ::handle myPlanesLocal; //!< object clipping planes - NCollection_Vector myDisabledPlanes; //!< ids of disabled planes + NCollection_DynamicArray myDisabledPlanes; //!< ids of disabled planes // clang-format off occ::handle myCappedChain; //!< chain which is either temporary disabled or the only one enabled for Capping algorithm diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ClippingIterator.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ClippingIterator.hxx index 864a2eef4e..28f45fbad7 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ClippingIterator.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ClippingIterator.hxx @@ -66,7 +66,7 @@ public: private: Graphic3d_SequenceOfHClipPlane::Iterator myIter1; Graphic3d_SequenceOfHClipPlane::Iterator myIter2; - const NCollection_Vector* myDisabled; + const NCollection_DynamicArray* myDisabled; int myCurrIndex; }; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx index 529a8d41f7..e32dfc6396 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -2086,7 +2086,7 @@ void OpenGl_Context::ReleaseDelayed() } // release delayed shared resources - NCollection_Vector aDeadList; + NCollection_DynamicArray aDeadList; for (NCollection_DataMap::Iterator anIter(*myDelayed); anIter.More(); anIter.Next()) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx index 9b2c9bc6d0..b800fa32a7 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx @@ -76,7 +76,7 @@ void OpenGl_Font::Release(OpenGl_Context* theCtx) size_t OpenGl_Font::EstimatedDataSize() const { size_t aSize = 0; - for (NCollection_Vector>::Iterator aTexIter(myTextures); + for (NCollection_DynamicArray>::Iterator aTexIter(myTextures); aTexIter.More(); aTexIter.Next()) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.hxx index 9da748ba86..812a8bdb17 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.hxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include class Font_FTFont; @@ -114,8 +114,8 @@ protected: RectI myLastTilePx; int myTextureFormat; //!< texture format - NCollection_Vector> myTextures; //!< array of textures - NCollection_Vector myTiles; //!< array of loaded tiles + NCollection_DynamicArray> myTextures; //!< array of textures + NCollection_DynamicArray myTiles; //!< array of loaded tiles NCollection_DataMap myGlyphMap; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx index 06b7dca88e..f09aabeeea 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx @@ -26,13 +26,13 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_FrameBuffer, OpenGl_NamedResource) namespace { //! Checks whether two format arrays are equal or not. -static bool operator==(const NCollection_Vector& theFmt1, - const NCollection_Vector& theFmt2) +static bool operator==(const NCollection_DynamicArray& theFmt1, + const NCollection_DynamicArray& theFmt2) { if (theFmt1.Length() != theFmt2.Length()) return false; - NCollection_Vector::Iterator anIt1(theFmt1); - NCollection_Vector::Iterator anIt2(theFmt1); + NCollection_DynamicArray::Iterator anIt1(theFmt1); + NCollection_DynamicArray::Iterator anIt2(theFmt1); for (; anIt1.More(); anIt1.Next(), anIt2.Next()) { if (anIt1.Value() != anIt2.Value()) @@ -206,7 +206,7 @@ bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, const int theDepthFormat, const int theNbSamples) { - NCollection_Vector aColorFormats; + NCollection_DynamicArray aColorFormats; if (theColorFormat != 0) { aColorFormats.Append(theColorFormat); @@ -216,11 +216,11 @@ bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, //================================================================================================= -bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const occ::handle& theDepthStencilTexture, - const int theNbSamples) +bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const occ::handle& theDepthStencilTexture, + const int theNbSamples) { myColorFormats = theColorFormats; @@ -354,11 +354,11 @@ bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, //================================================================================================= -bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples) +bool OpenGl_FrameBuffer::Init(const occ::handle& theGlContext, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples) { myColorFormats = theColorFormats; @@ -579,18 +579,18 @@ bool OpenGl_FrameBuffer::InitLazy(const occ::handle& theGlContex const int theDepthFormat, const int theNbSamples) { - NCollection_Vector aColorFormats; + NCollection_DynamicArray aColorFormats; aColorFormats.Append(theColorFormat); return InitLazy(theGlContext, theViewportSize, aColorFormats, theDepthFormat, theNbSamples); } //================================================================================================= -bool OpenGl_FrameBuffer::InitLazy(const occ::handle& theGlContext, - const NCollection_Vec2& theViewportSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples) +bool OpenGl_FrameBuffer::InitLazy(const occ::handle& theGlContext, + const NCollection_Vec2& theViewportSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples) { if (myVPSizeX == theViewportSize.x() && myVPSizeY == theViewportSize.y() && myColorFormats == theColorFormats && myDepthFormat == theDepthFormat @@ -610,7 +610,7 @@ bool OpenGl_FrameBuffer::InitWithRB(const occ::handle& theGlCtx, const int theDepthFormat, const unsigned int theColorRBufferFromWindow) { - NCollection_Vector aColorFormats; + NCollection_DynamicArray aColorFormats; if (theColorFormat != 0) { aColorFormats.Append(theColorFormat); @@ -625,11 +625,11 @@ bool OpenGl_FrameBuffer::InitWithRB(const occ::handle& theGlCtx, //================================================================================================= -bool OpenGl_FrameBuffer::initRenderBuffer(const occ::handle& theGlCtx, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples, +bool OpenGl_FrameBuffer::initRenderBuffer(const occ::handle& theGlCtx, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples, const unsigned int theColorRBufferFromWindow) { myColorFormats = theColorFormats; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.hxx index 19b04f765e..f968bcf543 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include class Image_PixMap; @@ -114,11 +114,11 @@ public: //! @param theDepthStencilTexture depth-stencil texture //! @param theNbSamples MSAA number of samples (0 means normal texture) //! @return true on success - Standard_EXPORT bool Init(const occ::handle& theGlCtx, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const occ::handle& theDepthStencilTexture, - const int theNbSamples = 0); + Standard_EXPORT bool Init(const occ::handle& theGlCtx, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const occ::handle& theDepthStencilTexture, + const int theNbSamples = 0); //! Initialize FBO for rendering into textures. //! @param theGlCtx currently bound OpenGL context @@ -144,11 +144,11 @@ public: //! GL_DEPTH24_STENCIL8 //! @param theNbSamples MSAA number of samples (0 means normal texture) //! @return true on success - Standard_EXPORT bool Init(const occ::handle& theGlCtx, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples = 0); + Standard_EXPORT bool Init(const occ::handle& theGlCtx, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples = 0); //! (Re-)initialize FBO with specified dimensions. Standard_EXPORT bool InitLazy(const occ::handle& theGlCtx, @@ -158,11 +158,11 @@ public: const int theNbSamples = 0); //! (Re-)initialize FBO with specified dimensions. - Standard_EXPORT bool InitLazy(const occ::handle& theGlCtx, - const NCollection_Vec2& theViewportSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples = 0); + Standard_EXPORT bool InitLazy(const occ::handle& theGlCtx, + const NCollection_Vec2& theViewportSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples = 0); //! (Re-)initialize FBO with properties taken from another FBO. bool InitLazy(const occ::handle& theGlCtx, @@ -185,11 +185,11 @@ public: //! define only one element //! @param theDepthFormat depth-stencil render buffer sized format, e.g. GL_DEPTH24_STENCIL8 //! @param theNbSamples MSAA number of samples (0 means normal render buffer) - bool InitRenderBuffer(const occ::handle& theGlCtx, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples = 0) + bool InitRenderBuffer(const occ::handle& theGlCtx, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples = 0) { return initRenderBuffer(theGlCtx, theSize, theColorFormats, theDepthFormat, theNbSamples, 0); } @@ -273,21 +273,21 @@ public: //! @param theNbSamples MSAA number of samples (0 means normal render buffer) //! @param theColorRBufferFromWindow when specified - should be ID of already initialized RB //! object, which will be released within this class - Standard_EXPORT bool initRenderBuffer(const occ::handle& theGlCtx, - const NCollection_Vec2& theSize, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples, + Standard_EXPORT bool initRenderBuffer(const occ::handle& theGlCtx, + const NCollection_Vec2& theSize, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples, const unsigned int theColorRBufferFromWindow); //! Initialize FBO for rendering into single/multiple color buffer and depth textures. Standard_DEPRECATED("Obsolete method, use Init() taking NCollection_Vec2") - bool Init(const occ::handle& theGlCtx, - const int theSizeX, - const int theSizeY, - const NCollection_Vector& theColorFormats, - const occ::handle& theDepthStencilTexture, - const int theNbSamples = 0) + bool Init(const occ::handle& theGlCtx, + const int theSizeX, + const int theSizeY, + const NCollection_DynamicArray& theColorFormats, + const occ::handle& theDepthStencilTexture, + const int theNbSamples = 0) { return Init(theGlCtx, NCollection_Vec2(theSizeX, theSizeY), @@ -314,12 +314,12 @@ public: //! Initialize FBO for rendering into single/multiple color buffer and depth textures. Standard_DEPRECATED("Obsolete method, use Init() taking NCollection_Vec2") - bool Init(const occ::handle& theGlCtx, - const int theSizeX, - const int theSizeY, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples = 0) + bool Init(const occ::handle& theGlCtx, + const int theSizeX, + const int theSizeY, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples = 0) { return Init(theGlCtx, NCollection_Vec2(theSizeX, theSizeY), @@ -346,12 +346,12 @@ public: //! (Re-)initialize FBO with specified dimensions. Standard_DEPRECATED("Obsolete method, use InitLazy() taking NCollection_Vec2") - bool InitLazy(const occ::handle& theGlCtx, - const int theViewportSizeX, - const int theViewportSizeY, - const NCollection_Vector& theColorFormats, - const int theDepthFormat, - const int theNbSamples = 0) + bool InitLazy(const occ::handle& theGlCtx, + const int theViewportSizeX, + const int theViewportSizeY, + const NCollection_DynamicArray& theColorFormats, + const int theDepthFormat, + const int theNbSamples = 0) { return InitLazy(theGlCtx, NCollection_Vec2(theViewportSizeX, theViewportSizeY), @@ -382,7 +382,7 @@ protected: bool isValidFrameBuffer() const { return myGlFBufferId != NO_FRAMEBUFFER; } protected: - typedef NCollection_Vector> OpenGl_TextureArray; + typedef NCollection_DynamicArray> OpenGl_TextureArray; protected: // clang-format off @@ -391,7 +391,7 @@ protected: int myVPSizeX; //!< viewport width (should be <= texture width) int myVPSizeY; //!< viewport height (should be <= texture height) int myNbSamples; //!< number of MSAA samples - NCollection_Vector myColorFormats; //!< sized format for color texture, GL_RGBA8 by default + NCollection_DynamicArray myColorFormats; //!< sized format for color texture, GL_RGBA8 by default int myDepthFormat; //!< sized format for depth-stencil texture, GL_DEPTH24_STENCIL8 by default unsigned int myGlFBufferId; //!< FBO object ID unsigned int myGlColorRBufferId; //!< color Render Buffer object (alternative to myColorTexture) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_MatrixState.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_MatrixState.hxx index 498cf5f30f..40038f31e1 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_MatrixState.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_MatrixState.hxx @@ -17,7 +17,7 @@ #define _OpenGl_MatrixState_H__ #include -#include +#include #include //! Software implementation for OpenGL matrix stack. @@ -107,7 +107,7 @@ public: private: // clang-format off - NCollection_Vector::Mat4> myStack; //!< Collection used to maintenance matrix stack + NCollection_DynamicArray::Mat4> myStack; //!< Collection used to maintenance matrix stack // clang-format on typename OpenGl::MatrixType::Mat4 myCurrent; //!< Current matrix int myStackHead; //!< Index of stack head diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx index 2d50366509..b3e7576852 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx @@ -381,7 +381,7 @@ bool OpenGl_RaytraceGeometry::AcquireTextures(const occ::handle& } int aTexIter = 0; - for (NCollection_Vector>::Iterator aTexSrcIter(myTextures); + for (NCollection_DynamicArray>::Iterator aTexSrcIter(myTextures); aTexSrcIter.More(); aTexSrcIter.Next(), ++aTexIter) { @@ -477,7 +477,7 @@ int OpenGl_RaytraceGeometry::AddTexture(const occ::handle& theTe return -1; } - NCollection_Vector>::iterator anIter = + NCollection_DynamicArray>::iterator anIter = std::find(myTextures.begin(), myTextures.end(), theTexture); if (anIter == myTextures.end()) @@ -508,7 +508,7 @@ bool OpenGl_RaytraceGeometry::UpdateTextureHandles(const occ::handle>::Iterator aTexSrcIter(myTextures); + for (NCollection_DynamicArray>::Iterator aTexSrcIter(myTextures); aTexSrcIter.More(); aTexSrcIter.Next(), ++aTexIter) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx index 575375f7af..1a38fe43ec 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.hxx @@ -265,7 +265,7 @@ public: //! @name auxiliary methods protected: // clang-format off - NCollection_Vector> myTextures; //!< Array of texture maps shared between rendered objects + NCollection_DynamicArray> myTextures; //!< Array of texture maps shared between rendered objects std::vector myTextureHandles; //!< Array of unique 64-bit texture handles obtained from OpenGL int myTopLevelTreeDepth; //!< Depth of high-level scene BVH from last build int myBotLevelTreeDepth; //!< Maximum depth of bottom-level scene BVHs from last build diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx index 2e48ec4559..94c245785b 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx @@ -912,7 +912,7 @@ void OpenGl_Text::DumpJson(Standard_OStream& theOStream, int theDepth) const OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myTextures.Size()) - for (NCollection_Vector>::Iterator aCrdsIt(myTCrdsVbo); + for (NCollection_DynamicArray>::Iterator aCrdsIt(myTCrdsVbo); aCrdsIt.More(); aCrdsIt.Next()) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.hxx index 5266082f48..bbb0553469 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.hxx @@ -152,12 +152,13 @@ private: Font_Hinting theFontHinting) const; protected: - occ::handle myText; //!< text parameters - mutable occ::handle myFont; - mutable NCollection_Vector myTextures; //!< textures' IDs - mutable NCollection_Vector> myVertsVbo; //!< VBOs of vertices - // clang-format off - mutable NCollection_Vector> myTCrdsVbo; //!< VBOs of texture coordinates + occ::handle myText; //!< text parameters + mutable occ::handle myFont; + mutable NCollection_DynamicArray myTextures; //!< textures' IDs + mutable NCollection_DynamicArray> + myVertsVbo; //!< VBOs of vertices + // clang-format off + mutable NCollection_DynamicArray> myTCrdsVbo; //!< VBOs of texture coordinates mutable occ::handle myBndVertsVbo;//!< VBOs of vertices for bounding box // clang-format on mutable Font_Rect myBndBox; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx index 0e0791b6bb..4ba217e19f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.cxx @@ -42,10 +42,10 @@ void OpenGl_TextBuilder::createGlyphs( const occ::handle& theFormatter, const occ::handle& theCtx, OpenGl_Font& theFont, - NCollection_Vector& theTextures, - NCollection_Vector>>>& + NCollection_DynamicArray& theTextures, + NCollection_DynamicArray>>>& theVertsPerTexture, - NCollection_Vector>>>& + NCollection_DynamicArray>>>& theTCrdsPerTexture) { NCollection_Vec2 aVec(0.0f, 0.0f); @@ -83,12 +83,14 @@ void OpenGl_TextBuilder::createGlyphs( if (aListId >= theTextures.Length()) { theTextures.Append(aTexture); - theVertsPerTexture.Append(new NCollection_Vector>()); - theTCrdsPerTexture.Append(new NCollection_Vector>()); + theVertsPerTexture.Append(new NCollection_DynamicArray>()); + theTCrdsPerTexture.Append(new NCollection_DynamicArray>()); } - NCollection_Vector>& aVerts = *theVertsPerTexture.ChangeValue(aListId); - NCollection_Vector>& aTCrds = *theTCrdsPerTexture.ChangeValue(aListId); + NCollection_DynamicArray>& aVerts = + *theVertsPerTexture.ChangeValue(aListId); + NCollection_DynamicArray>& aTCrds = + *theTCrdsPerTexture.ChangeValue(aListId); // apply floor on position to avoid blurring issues // due to cross-pixel coordinates @@ -111,16 +113,16 @@ void OpenGl_TextBuilder::createGlyphs( //================================================================================================= void OpenGl_TextBuilder::Perform( - const occ::handle& theFormatter, - const occ::handle& theCtx, - OpenGl_Font& theFont, - NCollection_Vector& theTextures, - NCollection_Vector>& theVertsPerTexture, - NCollection_Vector>& theTCrdsPerTexture) + const occ::handle& theFormatter, + const occ::handle& theCtx, + OpenGl_Font& theFont, + NCollection_DynamicArray& theTextures, + NCollection_DynamicArray>& theVertsPerTexture, + NCollection_DynamicArray>& theTCrdsPerTexture) { - NCollection_Vector>>> + NCollection_DynamicArray>>> aVertsPerTexture; - NCollection_Vector>>> + NCollection_DynamicArray>>> aTCrdsPerTexture; createGlyphs(theFormatter, theCtx, theFont, theTextures, aVertsPerTexture, aTCrdsPerTexture); @@ -158,7 +160,7 @@ void OpenGl_TextBuilder::Perform( for (int aTextureIter = 0; aTextureIter < theTextures.Length(); ++aTextureIter) { - const NCollection_Vector>& aVerts = + const NCollection_DynamicArray>& aVerts = *aVertsPerTexture.Value(aTextureIter); occ::handle& aVertsVbo = theVertsPerTexture.ChangeValue(aTextureIter); if (!aVertsVbo->Init(theCtx, 2, aVerts.Length(), (GLfloat*)nullptr) @@ -172,7 +174,7 @@ void OpenGl_TextBuilder::Perform( } myVboEditor.Flush(); - const NCollection_Vector>& aTCrds = + const NCollection_DynamicArray>& aTCrds = *aTCrdsPerTexture.Value(aTextureIter); occ::handle& aTCrdsVbo = theTCrdsPerTexture.ChangeValue(aTextureIter); if (!aTCrdsVbo->Init(theCtx, 2, aVerts.Length(), (GLfloat*)nullptr) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.hxx index 51bf13bf1c..de76a6d47c 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextBuilder.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include class Font_TextFormatter; @@ -36,26 +36,26 @@ public: //! Creates texture quads for the given text. Standard_EXPORT void Perform( - const occ::handle& theFormatter, - const occ::handle& theContext, - OpenGl_Font& theFont, - NCollection_Vector& theTextures, - NCollection_Vector>& theVertsPerTexture, - NCollection_Vector>& theTCrdsPerTexture); + const occ::handle& theFormatter, + const occ::handle& theContext, + OpenGl_Font& theFont, + NCollection_DynamicArray& theTextures, + NCollection_DynamicArray>& theVertsPerTexture, + NCollection_DynamicArray>& theTCrdsPerTexture); protected: //! @name class auxiliary methods Standard_EXPORT void createGlyphs( const occ::handle& theFormatter, const occ::handle& theCtx, OpenGl_Font& theFont, - NCollection_Vector& theTextures, - NCollection_Vector>>>& + NCollection_DynamicArray& theTextures, + NCollection_DynamicArray>>>& theVertsPerTexture, - NCollection_Vector>>>& + NCollection_DynamicArray>>>& theTCrdsPerTexture); protected: //! @name class auxiliary fields - NCollection_Vector myTileRects; + NCollection_DynamicArray myTileRects; OpenGl_VertexBufferEditor> myVboEditor; }; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx index 8f47bcf78c..7ff6d44817 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx @@ -78,7 +78,7 @@ static bool checkWasFailedFbo(const occ::handle& theFboToChe //! Chooses compatible internal color format for OIT frame buffer. static bool chooseOitColorConfiguration(const occ::handle& theGlContext, const int theConfigIndex, - NCollection_Vector& theFormats) + NCollection_DynamicArray& theFormats) { theFormats.Clear(); switch (theConfigIndex) @@ -1521,7 +1521,7 @@ bool OpenGl_View::prepareFrameBuffers(Graphic3d_Camera::Projection& theProj) { for (int aPairIter = 0; aPairIter < 2; ++aPairIter) { - NCollection_Vector aColorFormats; + NCollection_DynamicArray aColorFormats; aColorFormats.Append(GL_RG32F); aColorFormats.Append(GL_RGBA16F); aColorFormats.Append(GL_RGBA16F); @@ -1683,7 +1683,7 @@ bool OpenGl_View::prepareFrameBuffers(Graphic3d_Camera::Projection& theProj) const occ::handle& aShadowFbo = aShadow->FrameBuffer(); if (aShadowFbo->GetVPSizeX() != myRenderParams.ShadowMapResolution && toUseShadowMap) { - NCollection_Vector aDummy; + NCollection_DynamicArray aDummy; if (!aShadowFbo->Init(aCtx, NCollection_Vec2(myRenderParams.ShadowMapResolution), aDummy, diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx index 0176b0c881..003c1af9bf 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx @@ -514,7 +514,7 @@ protected: //! @name Rendering properties GLint myFboColorFormat; //!< sized format for color attachments // clang-format off GLint myFboDepthFormat; //!< sized format for depth-stencil attachments - NCollection_Vector myFboOitColorConfig; //!< selected color format configuration for OIT color attachments + NCollection_DynamicArray myFboOitColorConfig; //!< selected color format configuration for OIT color attachments occ::handle myMainSceneFbos[2]; occ::handle myMainSceneFbosOit[2]; //!< Additional buffers for transparent draw of main layer. occ::handle myImmediateSceneFbos[2]; //!< Additional buffers for immediate layer in stereo mode. diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx index 6b0be54bf4..3038ee36bd 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "../../TKService/Shaders/Shaders_RaytraceBase_vs.pxx" #include "../../TKService/Shaders/Shaders_RaytraceBase_fs.pxx" @@ -216,7 +216,7 @@ bool OpenGl_View::updateRaytraceGeometry(const RaytraceUpdateMode theM else if (theMode == OpenGl_GUM_REBUILD) { // Actualize the hash map of structures - remove out-of-date records - NCollection_Vector aKeysToRemove( + NCollection_DynamicArray aKeysToRemove( myStructureStates.Extent() > 0 ? myStructureStates.Extent() : 1); for (NCollection_DataMap::Iterator anIter( myStructureStates); @@ -228,7 +228,7 @@ bool OpenGl_View::updateRaytraceGeometry(const RaytraceUpdateMode theM aKeysToRemove.Append(anIter.Key()); } } - for (NCollection_Vector::Iterator aKeyIter(aKeysToRemove); + for (NCollection_DynamicArray::Iterator aKeyIter(aKeysToRemove); aKeyIter.More(); aKeyIter.Next()) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx index af21a1f514..933bee1f73 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Window.cxx @@ -869,7 +869,7 @@ void OpenGl_Window::init() aDefFbo = new OpenGl_FrameBuffer(); } - NCollection_Vector aColorFormats; + NCollection_DynamicArray aColorFormats; aColorFormats.Append(GL_RGBA8); if (!aDefFbo->InitRenderBuffer(myGlContext, mySize, aColorFormats, GL_DEPTH24_STENCIL8)) { diff --git a/src/Visualization/TKService/Font/Font_TextFormatter.cxx b/src/Visualization/TKService/Font/Font_TextFormatter.cxx index d73ca58398..7932719fb3 100644 --- a/src/Visualization/TKService/Font/Font_TextFormatter.cxx +++ b/src/Visualization/TKService/Font/Font_TextFormatter.cxx @@ -26,10 +26,10 @@ namespace typedef NCollection_Vec2 Vec2f; //! Auxiliary function to translate corners by the vector. -inline void move(NCollection_Vector& theCorners, - const Vec2f& theMoveVec, - int theCharLower, - const int theCharUpper) +inline void move(NCollection_DynamicArray& theCorners, + const Vec2f& theMoveVec, + int theCharLower, + const int theCharUpper) { for (; theCharLower <= theCharUpper; ++theCharLower) { @@ -38,10 +38,10 @@ inline void move(NCollection_Vector& theCorners, } //! Auxiliary function to translate corners in vertical direction. -inline void moveY(NCollection_Vector& theCorners, - const float theMoveVec, - int theCharLower, - const int theCharUpper) +inline void moveY(NCollection_DynamicArray& theCorners, + const float theMoveVec, + int theCharLower, + const int theCharUpper) { for (; theCharLower <= theCharUpper; ++theCharLower) { diff --git a/src/Visualization/TKService/Font/Font_TextFormatter.hxx b/src/Visualization/TKService/Font/Font_TextFormatter.hxx index 5001b5a160..bf4d77b8eb 100644 --- a/src/Visualization/TKService/Font/Font_TextFormatter.hxx +++ b/src/Visualization/TKService/Font/Font_TextFormatter.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include class Font_FTFont; @@ -250,10 +250,10 @@ public: } //! Returns internal container of the top left corners of a formatted rectangles. - const NCollection_Vector>& Corners() const { return myCorners; } + const NCollection_DynamicArray>& Corners() const { return myCorners; } //! Returns container of each line position at LF in formatted text - const NCollection_Vector& NewLines() const { return myNewLines; } + const NCollection_DynamicArray& NewLines() const { return myNewLines; } //! Returns true if the symbol is CR, BEL, FF, NP, BS or VT static inline bool IsCommandSymbol(const char32_t& theSymbol) @@ -293,10 +293,10 @@ protected: //! @name configuration protected: //! @name input data NCollection_String myString; //!< currently rendered text NCollection_Vec2 myPen; //!< current pen position - NCollection_Vector> - myCorners; //!< The bottom left corners of a formatted rectangles. - NCollection_Vector myNewLines; //!< position at LF - // clang-format off + NCollection_DynamicArray> + myCorners; //!< The bottom left corners of a formatted rectangles. + NCollection_DynamicArray myNewLines; //!< position at LF + // clang-format off float myLineSpacing; //!< line spacing (computed as maximum of all fonts involved in text formatting) float myAscender; //!< line spacing for the first line bool myIsFormatted; //!< formatting state @@ -304,8 +304,8 @@ protected: //! @name input data protected: //! @name temporary variables for formatting routines int myLinesNb; //!< overall (new)lines number (including splitting by width limit) - // clang-format on - int myRectLineStart; //!< id of first rectangle on the current line + // clang-format on + int myRectLineStart; //!< id of first rectangle on the current line int myNewLineNb; float myPenCurrLine; //!< current baseline position diff --git a/src/Visualization/TKService/Image/Image_Diff.cxx b/src/Visualization/TKService/Image/Image_Diff.cxx index dcb5ad2d7a..0aa1db73e3 100644 --- a/src/Visualization/TKService/Image/Image_Diff.cxx +++ b/src/Visualization/TKService/Image/Image_Diff.cxx @@ -268,7 +268,7 @@ bool Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const { case Image_Format_Gray: case Image_Format_Alpha: { - for (NCollection_Vector::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); + for (NCollection_DynamicArray::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); aPixelIter.Next()) { theDiffImage.ChangeValue(UnpackY(aPixelIter.Value()), @@ -282,7 +282,7 @@ bool Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const case Image_Format_BGR32: case Image_Format_RGBA: case Image_Format_BGRA: { - for (NCollection_Vector::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); + for (NCollection_DynamicArray::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); aPixelIter.Next()) { memset( @@ -293,7 +293,7 @@ bool Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const break; } default: { - for (NCollection_Vector::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); + for (NCollection_DynamicArray::Iterator aPixelIter(myDiffPixels); aPixelIter.More(); aPixelIter.Next()) { theDiffImage.SetPixelColor(UnpackX(aPixelIter.Value()), diff --git a/src/Visualization/TKService/Image/Image_Diff.hxx b/src/Visualization/TKService/Image/Image_Diff.hxx index 6af5d3ee93..caa9b2dafe 100644 --- a/src/Visualization/TKService/Image/Image_Diff.hxx +++ b/src/Visualization/TKService/Image/Image_Diff.hxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include //! This class compares two images pixel-by-pixel. //! It uses the following methods to ignore the difference between images: @@ -141,7 +141,7 @@ protected: // clang-format on //! coordinates of different pixels, packed in one int using 16-bit integers to save memory - NCollection_Vector myDiffPixels; + NCollection_DynamicArray myDiffPixels; TColStd_PackedMapOfInteger myLinearGroups; NCollection_List> myGroupsOfDiffPixels; diff --git a/src/Visualization/TKV3d/AIS/AIS_ColoredShape.cxx b/src/Visualization/TKV3d/AIS/AIS_ColoredShape.cxx index 8b7810c141..da60c7b32f 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ColoredShape.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ColoredShape.cxx @@ -490,7 +490,7 @@ void AIS_ColoredShape::ComputeSelection(const occ::handle& aDeviationAngle); occ::handle aThis(this); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx b/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx index c6bca89560..4fd004b34f 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ConnectedInteractive.cxx @@ -209,7 +209,7 @@ void AIS_ConnectedInteractive::ComputeSelection( myReference->RecomputePrimitives(theMode); } - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( TheRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -249,7 +249,7 @@ void AIS_ConnectedInteractive::computeSubShapeSelection( // Fill in the map of subshapes and corresponding sensitive entities associated with aMode Shapes2EntitiesMap aShapes2EntitiesMap; - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx index 081df3effd..b7630fb8cf 100644 --- a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx @@ -3515,7 +3515,7 @@ void AIS_InteractiveContext::EntityOwners( continue; } - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx b/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx index 6d47f0a80b..1ca945206d 100644 --- a/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_PointCloud.cxx @@ -79,7 +79,7 @@ void AIS_PointCloudOwner::HilightWithColor(const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/Select3D/Select3D_InteriorSensitivePointSet.hxx b/src/Visualization/TKV3d/Select3D/Select3D_InteriorSensitivePointSet.hxx index 05b063dae7..e5f7d3264e 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_InteriorSensitivePointSet.hxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_InteriorSensitivePointSet.hxx @@ -89,7 +89,7 @@ protected: Standard_EXPORT double distanceToCOG(SelectBasics_SelectingVolumeManager& theMgr) override; protected: - NCollection_Vector> + NCollection_DynamicArray> myPlanarPolygons; //!< Vector of planar polygons occ::handle> myPolygonsIdxs; //!< Indexes array for BVH calculation gp_Pnt myCOG; //!< Center of the point set diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.hxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.hxx index 912d7039c8..45f7ca347d 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.hxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.hxx @@ -171,7 +171,7 @@ private: bool myToCheckOverlapAll; //!< flag to check overlapping with all entities within rectangular/polygonal selection gp_Pnt myCenter; //!< Center of geometry of the group mutable Select3D_BndBox3d myBndBox; //!< Bounding box of the group - NCollection_Vector myBVHPrimIndexes; //!< Vector of sub-entities indexes for BVH tree build + NCollection_DynamicArray myBVHPrimIndexes; //!< Vector of sub-entities indexes for BVH tree build // clang-format on }; diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.cxx index 67fd7cd1bc..b5b666755e 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.cxx @@ -150,7 +150,8 @@ occ::handle Select3D_SensitiveWire::GetConnected() // function : GetEdges // purpose : returns the sensitive edges stored in this wire //======================================================================= -const NCollection_Vector>& Select3D_SensitiveWire::GetEdges() +const NCollection_DynamicArray>& Select3D_SensitiveWire:: + GetEdges() { return myEntities; } @@ -218,7 +219,8 @@ void Select3D_SensitiveWire::DumpJson(Standard_OStream& theOStream, int theDepth OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream) OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Select3D_SensitiveSet) - for (NCollection_Vector>::Iterator anIterator(myEntities); + for (NCollection_DynamicArray>::Iterator anIterator( + myEntities); anIterator.More(); anIterator.Next()) { diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.hxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.hxx index 9965549e21..9228c691b9 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.hxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveWire.hxx @@ -37,7 +37,7 @@ public: Standard_EXPORT occ::handle GetConnected() override; //! returns the sensitive edges stored in this wire - Standard_EXPORT const NCollection_Vector>& GetEdges(); + Standard_EXPORT const NCollection_DynamicArray>& GetEdges(); //! Sets the owner for all entities in wire Standard_EXPORT void Set(const occ::handle& theOwnerId) override; @@ -88,8 +88,8 @@ protected: private: // clang-format off - NCollection_Vector> myEntities; //!< Vector of sub-entities - NCollection_Vector myEntityIndexes; //!< Indexes of entities for BVH build + NCollection_DynamicArray> myEntities; //!< Vector of sub-entities + NCollection_DynamicArray myEntityIndexes; //!< Indexes of entities for BVH build gp_Pnt myCenter; //!< Center of the whole wire mutable Select3D_BndBox3d myBndBox; //!< Bounding box of the whole wire // clang-format on diff --git a/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.hxx b/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.hxx index a3266c10f0..5f5a70ae9b 100644 --- a/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.hxx +++ b/src/Visualization/TKV3d/SelectBasics/SelectBasics_SelectingVolumeManager.hxx @@ -169,7 +169,8 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector - virtual void GetPlanes(NCollection_Vector>& thePlaneEquations) const = 0; + virtual void GetPlanes( + NCollection_DynamicArray>& thePlaneEquations) const = 0; //! Dumps the content of me into the stream virtual void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr.cxx index 075e6c6b57..b807e582ad 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr.cxx @@ -197,7 +197,7 @@ void SelectMgr::ComputeSensitivePrs(const occ::handle& NCollection_List>> aSeqLines, aSeqFree; NCollection_Sequence aSeqPoints; - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -248,9 +248,10 @@ void SelectMgr::ComputeSensitivePrs(const occ::handle& else if (occ::handle aWire = occ::down_cast(anEnt)) { - const NCollection_Vector>& anEntities = + const NCollection_DynamicArray>& anEntities = aWire->GetEdges(); - for (NCollection_Vector>::Iterator aSubIter(anEntities); + for (NCollection_DynamicArray>::Iterator aSubIter( + anEntities); aSubIter.More(); aSubIter.Next()) { diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.hxx index 2b8226660d..7ed0039365 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.hxx @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -125,7 +125,8 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector. //! This method only clears input vector for the base class. - virtual void GetPlanes(NCollection_Vector>& thePlaneEquations) const + virtual void GetPlanes( + NCollection_DynamicArray>& thePlaneEquations) const { thePlaneEquations.Clear(); } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx index d4abf49bdf..2e568965d3 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx @@ -14,7 +14,7 @@ // commercial license or contractual agreement. #include -#include +#include #include #include #include diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx index 3ac304ea28..c2d0cdcdc5 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -1107,7 +1107,7 @@ gp_Pnt SelectMgr_RectangularFrustum::DetectedPoint(const double theDepth) const //================================================================================================= void SelectMgr_RectangularFrustum::GetPlanes( - NCollection_Vector>& thePlaneEquations) const + NCollection_DynamicArray>& thePlaneEquations) const { thePlaneEquations.Clear(); diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.hxx index aca75a53fc..283329de72 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.hxx @@ -241,7 +241,7 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector Standard_EXPORT void GetPlanes( - NCollection_Vector>& thePlaneEquations) const override; + NCollection_DynamicArray>& thePlaneEquations) const override; //! Dumps the content of me into the stream Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override; diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx index ee777e92b4..7992d6014e 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectableObject.cxx @@ -261,7 +261,7 @@ void SelectMgr_SelectableObject::UpdateTransformations( const occ::handle& theSel) { const TopLoc_Location aSelfLocation(Transformation()); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -390,7 +390,7 @@ void SelectMgr_SelectableObject::SetZLayer(const Graphic3d_ZLayerId theLayerId) aSelIter.Next()) { const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -470,7 +470,7 @@ void SelectMgr_SelectableObject::SetAssemblyOwner( aSelIter.Next()) { const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -488,7 +488,7 @@ void SelectMgr_SelectableObject::SetAssemblyOwner( const occ::handle& aSel = aSelIter.Value(); if (aSel->Mode() == theMode) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -518,7 +518,7 @@ Bnd_Box SelectMgr_SelectableObject::BndBoxOfSelected( if (aSel->GetSelectionState() != SelectMgr_SOS_Activated) continue; - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.cxx index c0f87e0f2e..5bc07a50e6 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.cxx @@ -629,7 +629,7 @@ gp_Pnt2d SelectMgr_SelectingVolumeManager::GetMousePosition() const //================================================================================================= void SelectMgr_SelectingVolumeManager::GetPlanes( - NCollection_Vector>& thePlaneEquations) const + NCollection_DynamicArray>& thePlaneEquations) const { if (myActiveSelectingVolume.IsNull()) { diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.hxx index fa8b009da6..d98c3212e4 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectingVolumeManager.hxx @@ -282,7 +282,7 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector Standard_EXPORT void GetPlanes( - NCollection_Vector>& thePlaneEquations) const override; + NCollection_DynamicArray>& thePlaneEquations) const override; //! Dumps the content of me into the stream Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override; diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx index 475604cd07..56504f6f21 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx @@ -41,7 +41,7 @@ SelectMgr_Selection::~SelectMgr_Selection() void SelectMgr_Selection::Destroy() { - for (NCollection_Vector>::Iterator anEntityIter( + for (NCollection_DynamicArray>::Iterator anEntityIter( myEntities); anEntityIter.More(); anEntityIter.Next()) @@ -86,7 +86,7 @@ void SelectMgr_Selection::Add(const occ::handle& theSe void SelectMgr_Selection::Clear() { - for (NCollection_Vector>::Iterator anEntityIter( + for (NCollection_DynamicArray>::Iterator anEntityIter( myEntities); anEntityIter.More(); anEntityIter.Next()) @@ -108,7 +108,7 @@ void SelectMgr_Selection::SetSensitivity(const int theNewSens) { mySensFactor = theNewSens; myIsCustomSens = true; - for (NCollection_Vector>::Iterator anEntityIter( + for (NCollection_DynamicArray>::Iterator anEntityIter( myEntities); anEntityIter.More(); anEntityIter.Next()) @@ -125,7 +125,8 @@ void SelectMgr_Selection::DumpJson(Standard_OStream& theOStream, int theDepth) c OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream) NCollection_Map> anOwners; - for (NCollection_Vector>::Iterator anIterator(myEntities); + for (NCollection_DynamicArray>::Iterator anIterator( + myEntities); anIterator.More(); anIterator.Next()) { @@ -141,7 +142,8 @@ void SelectMgr_Selection::DumpJson(Standard_OStream& theOStream, int theDepth) c } } - for (NCollection_Vector>::Iterator anIterator(myEntities); + for (NCollection_DynamicArray>::Iterator anIterator( + myEntities); anIterator.More(); anIterator.Next()) { diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.hxx index d4f823cb45..32aa12b9a6 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.hxx @@ -85,13 +85,13 @@ public: int Mode() const { return myMode; } //! Return entities. - const NCollection_Vector>& Entities() const + const NCollection_DynamicArray>& Entities() const { return myEntities; } //! Return entities. - NCollection_Vector>& ChangeEntities() + NCollection_DynamicArray>& ChangeEntities() { return myEntities; } @@ -131,13 +131,13 @@ public: Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const; private: - NCollection_Vector> myEntities; - int myMode; - SelectMgr_TypeOfUpdate myUpdateStatus; - mutable SelectMgr_StateOfSelection mySelectionState; - mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus; - int mySensFactor; - bool myIsCustomSens; + NCollection_DynamicArray> myEntities; + int myMode; + SelectMgr_TypeOfUpdate myUpdateStatus; + mutable SelectMgr_StateOfSelection mySelectionState; + mutable SelectMgr_TypeOfBVHUpdate myBVHUpdateStatus; + int mySensFactor; + bool myIsCustomSens; }; #endif diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx index 3f09cedf1b..9383333996 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx @@ -36,7 +36,7 @@ public: aSelIter.Next()) { const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -90,7 +90,7 @@ public: aSelIter.Next()) { const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -251,7 +251,7 @@ public: aSelIter.Next()) { const occ::handle& aSel = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSel->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -330,7 +330,7 @@ public: aSelIter.Next()) { const occ::handle& aSelection = aSelIter.Value(); - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( aSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx index ccc1bb4034..2e57de4bc6 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionManager.cxx @@ -547,7 +547,7 @@ void SelectMgr_SelectionManager::buildBVH(const occ::handle { if (mySelector->ToPrebuildBVH()) { - for (NCollection_Vector>::Iterator anIter( + for (NCollection_DynamicArray>::Iterator anIter( theSelection->Entities()); anIter.More(); anIter.Next()) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntitySet.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntitySet.cxx index fe478db652..aca2a3fc97 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntitySet.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SensitiveEntitySet.cxx @@ -66,7 +66,7 @@ void SelectMgr_SensitiveEntitySet::Append(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -102,7 +102,7 @@ void SelectMgr_SensitiveEntitySet::Append(const occ::handle //======================================================================= void SelectMgr_SensitiveEntitySet::Remove(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx index 74c954d9c7..635ae2499c 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx @@ -407,7 +407,7 @@ void SelectMgr_TriangularFrustum::Clear() //================================================================================================= void SelectMgr_TriangularFrustum::GetPlanes( - NCollection_Vector>& thePlaneEquations) const + NCollection_DynamicArray>& thePlaneEquations) const { NCollection_Vec4 aPlaneEquation; for (int aPlaneIdx = 0; aPlaneIdx < 5; ++aPlaneIdx) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.hxx index bc2593032b..c6507e9d9e 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.hxx @@ -165,7 +165,7 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector Standard_EXPORT void GetPlanes( - NCollection_Vector>& thePlaneEquations) const override; + NCollection_DynamicArray>& thePlaneEquations) const override; //! Dumps the content of me into the stream Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override; diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index 95684d6e75..63a9359999 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -816,7 +816,7 @@ bool SelectMgr_TriangularFrustumSet::OverlapsCircle(const double theRadius, //================================================================================================= void SelectMgr_TriangularFrustumSet::GetPlanes( - NCollection_Vector>& thePlaneEquations) const + NCollection_DynamicArray>& thePlaneEquations) const { thePlaneEquations.Clear(); diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.hxx index ef8d02bcd8..cc4145f60c 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.hxx @@ -159,7 +159,7 @@ public: //! Stores plane equation coefficients (in the following form: //! Ax + By + Cz + D = 0) to the given vector Standard_EXPORT void GetPlanes( - NCollection_Vector>& thePlaneEquations) const override; + NCollection_DynamicArray>& thePlaneEquations) const override; //! If theIsToAllow is false, only fully included sensitives will be detected, otherwise the //! algorithm will mark both included and overlapped entities as matched diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx index d0f2b5a4cb..b14fb3ffe8 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -201,7 +201,7 @@ void SelectMgr_ViewerSelector::SetPixelTolerance(const int theTolerance) void SelectMgr_ViewerSelector::Activate(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -221,7 +221,7 @@ void SelectMgr_ViewerSelector::Activate(const occ::handle& void SelectMgr_ViewerSelector::Deactivate(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx index 6b0df8b4eb..36e9170fad 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx @@ -53,8 +53,8 @@ const gp_Lin2d isoV(const double theV) return gp_Lin2d(gp_Pnt2d(0.0, theV), gp::DX2d()); } -typedef NCollection_Shared> VecOfSegments; -typedef NCollection_Sequence> SeqOfVecOfSegments; +typedef NCollection_Shared> VecOfSegments; +typedef NCollection_Sequence> SeqOfVecOfSegments; //! Pack isoline segments into polylines. static void sortSegments(const SeqOfVecOfSegments& theSegments, diff --git a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx index d6ee3c66b9..956988ffb3 100644 --- a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -105,7 +105,7 @@ static bool isCylinderOrCone(const TopoDS_Face& theFace) //================================================== void StdSelect_BRepSelectionTool::PreBuildBVH(const occ::handle& theSelection) { - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next()) @@ -223,7 +223,7 @@ void StdSelect_BRepSelectionTool::Load( theMaxParam); // loading of selectables... - for (NCollection_Vector>::Iterator aSelEntIter( + for (NCollection_DynamicArray>::Iterator aSelEntIter( theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())