{
}
-unsigned long SMDS_UnstructuredGrid::GetMTime()
+vtkMTimeType SMDS_UnstructuredGrid::GetMTime()
{
- unsigned long mtime = vtkUnstructuredGrid::GetMTime();
+ vtkMTimeType mtime = vtkUnstructuredGrid::GetMTime();
return mtime;
}
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
// --- 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;
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();