X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_UnstructuredGrid.cxx;h=bf9df36cffc1c1c80eb5fa3b3fde23e680f301a0;hb=c7d720eb8a7192a3316c968df9451e3a6d0f3f8d;hp=e32eb798c36abd87b71863c4853e9a88eb889048;hpb=75d0234b452659c44159aaf33ed833af89a0ff4c;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index e32eb798c..bf9df36cf 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -125,9 +125,9 @@ SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid() { } -unsigned long SMDS_UnstructuredGrid::GetMTime() +vtkMTimeType SMDS_UnstructuredGrid::GetMTime() { - unsigned long mtime = vtkUnstructuredGrid::GetMTime(); + vtkMTimeType mtime = vtkUnstructuredGrid::GetMTime(); return mtime; } @@ -139,10 +139,12 @@ vtkPoints* SMDS_UnstructuredGrid::GetPoints() int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts) { - if ( !this->Links ) - BuildLinks(); + if ( !this->Links ) // don't create Links until they are needed + { + return this->InsertNextCell(type, npts, pts); + } - if (type != VTK_POLYHEDRON) + if ( type != VTK_POLYHEDRON ) return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts); // --- type = VTK_POLYHEDRON @@ -187,13 +189,14 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n // --- if newNodeSize, create a new compacted vtkPoints - vtkPoints *newPoints = vtkPoints::New(); - newPoints->SetDataType(VTK_DOUBLE); - newPoints->SetNumberOfPoints(newNodeSize); - if (newNodeSize) + if ( newNodeSize ) { // rnv: to fix bug "21125: EDF 1233 SMESH: Degradation of precision in a test case for quadratic conversion" // using double type for storing coordinates of nodes instead float. + vtkPoints *newPoints = vtkPoints::New(); + newPoints->SetDataType(VTK_DOUBLE); + newPoints->SetNumberOfPoints(newNodeSize); + int oldNodeSize = idNodesOldToNew.size(); int i = 0; @@ -209,21 +212,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n int endBloc = i; copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc); } - newPoints->Squeeze(); - } - - if (1/*newNodeSize*/) - { this->SetPoints(newPoints); + newPoints->Delete(); } - newPoints->Delete(); - + this->Points->Squeeze(); // --- create new compacted Connectivity, Locations and Types int oldCellSize = this->Types->GetNumberOfTuples(); - if ( oldCellSize == newCellSize ) // no holes in elements + if ( !newNodeSize && oldCellSize == newCellSize ) // no holes in elements { this->Connectivity->Squeeze(); this->Locations->Squeeze();