From: aml Date: Thu, 3 Sep 2015 12:05:34 +0000 (+0300) Subject: 0026593: Coding rules - revert compatibility of NCollection_CellFilter constructor... X-Git-Tag: V7_0_0_beta~320 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=a7653f4f55ac4547ea8e7eeb3e40c367c00f4a06 0026593: Coding rules - revert compatibility of NCollection_CellFilter constructor with old code Restored old constructor and old behavior where possible. Minor correction. --- diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index 0b46d115e3..900481b5f9 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -284,7 +284,7 @@ void BRepBuilderAPI_FastSewing::Perform(void) Standard_Real aRange = Compute3DRange(); Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator; NCollection_CellFilter - aCells(NodeInspector::Dimension, Max(myTolerance, aRange/IntegerLast()), anAlloc); + aCells(Max(myTolerance, aRange/IntegerLast()), anAlloc); for(Standard_Integer i = myFaceVec.Lower(); i <= myFaceVec.Upper(); i++) { diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 1bd77e5693..4a8407c712 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -2778,7 +2778,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte Standard_Integer i, nbVertices = aVertexNode.Extent(); // Create map of node -> vertices TopTools_IndexedDataMapOfShapeListOfShape NodeVertices; - BRepBuilderAPI_CellFilter aFilter (BRepBuilderAPI_VertexInspector::Dimension, Tolerance); + BRepBuilderAPI_CellFilter aFilter (Tolerance); BRepBuilderAPI_VertexInspector anInspector (Tolerance); for (i = 1; i <= nbVertices; i++) { TopoDS_Shape vertex = aVertexNode.FindKey(i); diff --git a/src/BRepMesh/BRepMesh_CircleTool.cxx b/src/BRepMesh/BRepMesh_CircleTool.cxx index 1437adfb64..5697216273 100644 --- a/src/BRepMesh/BRepMesh_CircleTool.cxx +++ b/src/BRepMesh/BRepMesh_CircleTool.cxx @@ -50,7 +50,7 @@ BRepMesh_CircleTool::BRepMesh_CircleTool( const Handle(NCollection_IncAllocator)& theAllocator) : myTolerance (Precision::PConfusion() * Precision::PConfusion()), myAllocator (theAllocator), - myCellFilter(BRepMesh_CircleInspector::Dimension, 10, theAllocator), + myCellFilter(10, theAllocator), mySelector (myTolerance, 64, theAllocator) { } @@ -64,7 +64,7 @@ BRepMesh_CircleTool::BRepMesh_CircleTool( const Handle(NCollection_IncAllocator)& theAllocator) : myTolerance (Precision::PConfusion() * Precision::PConfusion()), myAllocator (theAllocator), - myCellFilter(BRepMesh_CircleInspector::Dimension, 10, theAllocator), + myCellFilter(10, theAllocator), mySelector (myTolerance, Max(theReservedSize, 64), theAllocator) { } diff --git a/src/BRepMesh/BRepMesh_VertexTool.cxx b/src/BRepMesh/BRepMesh_VertexTool.cxx index 519ec2599c..dfdff4bd09 100644 --- a/src/BRepMesh/BRepMesh_VertexTool.cxx +++ b/src/BRepMesh/BRepMesh_VertexTool.cxx @@ -59,7 +59,7 @@ BRepMesh_VertexTool::BRepMesh_VertexTool( const Standard_Integer theReservedSize, const Handle(NCollection_IncAllocator)& theAllocator) : myAllocator (theAllocator), - myCellFilter(BRepMesh_VertexInspector::Dimension, 0., myAllocator), + myCellFilter(0., myAllocator), mySelector (Max(theReservedSize, 64),myAllocator) { const Standard_Real aTol = Precision::Confusion(); diff --git a/src/Extrema/Extrema_GenExtCC.gxx b/src/Extrema/Extrema_GenExtCC.gxx index 421d507535..6acba89bd9 100644 --- a/src/Extrema/Extrema_GenExtCC.gxx +++ b/src/Extrema/Extrema_GenExtCC.gxx @@ -210,7 +210,7 @@ void Extrema_GenExtCC::Perform() anIntervals2.Upper() - anIntervals2.Lower()) * Precision::PConfusion() / (2.0 * Sqrt(2.0)); Extrema_CCPointsInspector anInspector(Precision::PConfusion()); - NCollection_CellFilter aFilter(Extrema_CCPointsInspector::Dimension, aCellSize); + NCollection_CellFilter aFilter(aCellSize); NCollection_Vector aPnts; Standard_Integer i,j,k; diff --git a/src/NCollection/NCollection_CellFilter.hxx b/src/NCollection/NCollection_CellFilter.hxx index 1011641093..9c6dfac4d1 100644 --- a/src/NCollection/NCollection_CellFilter.hxx +++ b/src/NCollection/NCollection_CellFilter.hxx @@ -129,6 +129,7 @@ public: //! By default cell size is 0, which is invalid; thus if default //! constructor is used, the tool must be initialized later with //! appropriate cell size by call to Reset() + //! Constructor when dimension count is unknown at compilation time. NCollection_CellFilter (const Standard_Integer theDim, const Standard_Real theCellSize = 0, const Handle(NCollection_IncAllocator)& theAlloc = 0) @@ -138,6 +139,15 @@ public: Reset (theCellSize, theAlloc); } + //! Constructor when dimenstion count is known at compilation time. + NCollection_CellFilter (const Standard_Real theCellSize = 0, + const Handle(NCollection_IncAllocator)& theAlloc = 0) + : myCellSize(0, Inspector::Dimension - 1) + { + myDim = Inspector::Dimension; + Reset (theCellSize, theAlloc); + } + //! Clear the data structures, set new cell size and allocator void Reset (Standard_Real theCellSize, const Handle(NCollection_IncAllocator)& theAlloc=0) diff --git a/src/RWStl/RWStl.cxx b/src/RWStl/RWStl.cxx index 042269b3bd..2ef056e243 100644 --- a/src/RWStl/RWStl.cxx +++ b/src/RWStl/RWStl.cxx @@ -391,7 +391,7 @@ Handle(StlMesh_Mesh) RWStl::ReadBinary (const OSD_Path& thePath, ReadMesh->AddDomain (); // Filter unique vertices to share the nodes of the mesh. - BRepBuilderAPI_CellFilter uniqueVertices(BRepBuilderAPI_VertexInspector::Dimension, Precision::Confusion()); + BRepBuilderAPI_CellFilter uniqueVertices(Precision::Confusion()); BRepBuilderAPI_VertexInspector inspector(Precision::Confusion()); for (ifacet=1; ifacet<=NBFACET; ++ifacet) { @@ -480,7 +480,7 @@ Handle(StlMesh_Mesh) RWStl::ReadAscii (const OSD_Path& thePath, ReadMesh->AddDomain(); // Filter unique vertices to share the nodes of the mesh. - BRepBuilderAPI_CellFilter uniqueVertices(BRepBuilderAPI_VertexInspector::Dimension, Precision::Confusion()); + BRepBuilderAPI_CellFilter uniqueVertices(Precision::Confusion()); BRepBuilderAPI_VertexInspector inspector(Precision::Confusion()); // main reading