Salome HOME
Fix for the 21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadr...
authorrnv <rnv@opencascade.com>
Mon, 10 Jan 2011 15:38:48 +0000 (15:38 +0000)
committerrnv <rnv@opencascade.com>
Mon, 10 Jan 2011 15:38:48 +0000 (15:38 +0000)
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_UnstructuredGrid.cxx

index 792e3e22194316b58ad769f68141883481966b28..ab63d6280e82c5d930b83f2c01aee45e4d61988a 100644 (file)
@@ -154,6 +154,9 @@ SMDS_Mesh::SMDS_Mesh()
   myGrid->Initialize();
   myGrid->Allocate();
   vtkPoints* points = vtkPoints::New();
+  // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
+  // using double type for storing coordinates of nodes instead float.
+  points->SetDataType(VTK_DOUBLE);
   points->SetNumberOfPoints(SMDS_Mesh::chunkSize);
   myGrid->SetPoints( points );
   points->Delete();
@@ -2503,6 +2506,9 @@ void SMDS_Mesh::Clear()
   myGrid->Initialize();
   myGrid->Allocate();
   vtkPoints* points = vtkPoints::New();
+  // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
+  // using double type for storing coordinates of nodes instead float.
+  points->SetDataType(VTK_DOUBLE);
   points->SetNumberOfPoints(SMDS_Mesh::chunkSize);
   myGrid->SetPoints( points );
   points->Delete();
index 2db632a74cb71114a4e0be8169f65c979efcee56..ec30d5b641015af30f76375cb4815831d7c837a3 100644 (file)
@@ -160,6 +160,9 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
     {
       MESSAGE("-------------- compactGrid, newNodeSize " << newNodeSize);
       newPoints = vtkPoints::New();
+      // rnv: to fix bug "21125: EDF 1233 SMESH: Degrardation of precision in a test case for quadratic conversion"
+      // using double type for storing coordinates of nodes instead float.
+      newPoints->SetDataType(VTK_DOUBLE);
       newPoints->Initialize();
       newPoints->Allocate(newNodeSize);
       newPoints->SetNumberOfPoints(newNodeSize);
@@ -371,7 +374,7 @@ void SMDS_UnstructuredGrid::copyNodes(vtkPoints *newPoints, std::vector<int>& id
   int nbPoints = end - start;
   if (nbPoints > 0)
     {
-      memcpy(target, source, 3 * sizeof(float) * nbPoints);
+      memcpy(target, source, 3 * sizeof(double) * nbPoints);
       for (int j = start; j < end; j++)
         idNodesOldToNew[j] = alreadyCopied++; // old vtkId --> new vtkId
         //idNodesOldToNew[alreadyCopied++] = idNodesOldToNew[j]; // new vtkId --> old SMDS id