0026593: Coding rules - revert compatibility of NCollection_CellFilter constructor...
authoraml <aml@opencascade.com>
Thu, 3 Sep 2015 12:05:34 +0000 (15:05 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 3 Sep 2015 12:06:26 +0000 (15:06 +0300)
Restored old constructor and old behavior where possible.

Minor correction.

src/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx
src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
src/BRepMesh/BRepMesh_CircleTool.cxx
src/BRepMesh/BRepMesh_VertexTool.cxx
src/Extrema/Extrema_GenExtCC.gxx
src/NCollection/NCollection_CellFilter.hxx
src/RWStl/RWStl.cxx

index 0b46d11..900481b 100644 (file)
@@ -284,7 +284,7 @@ void BRepBuilderAPI_FastSewing::Perform(void)
       Standard_Real aRange = Compute3DRange();
       Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator;
       NCollection_CellFilter<NodeInspector> 
-        aCells(NodeInspector::Dimension, Max(myTolerance, aRange/IntegerLast()), anAlloc);
+        aCells(Max(myTolerance, aRange/IntegerLast()), anAlloc);
 
       for(Standard_Integer i = myFaceVec.Lower(); i <= myFaceVec.Upper(); i++)
       {
index 1bd77e5..4a8407c 100644 (file)
@@ -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);
index 1437adf..5697216 100644 (file)
@@ -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)
 {
 }
index 519ec25..dfdff4b 100644 (file)
@@ -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();
index 421d507..6acba89 100644 (file)
@@ -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<Extrema_CCPointsInspector> aFilter(Extrema_CCPointsInspector::Dimension, aCellSize);
+  NCollection_CellFilter<Extrema_CCPointsInspector> aFilter(aCellSize);
   NCollection_Vector<gp_XY> aPnts;
 
   Standard_Integer i,j,k;
index 1011641..9c6dfac 100644 (file)
@@ -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)
index 042269b..2ef056e 100644 (file)
@@ -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