Salome HOME
Optimize performance of mesh deletion upon hyp modification
[modules/smesh.git] / src / SMDS / SMDS_UnstructuredGrid.cxx
index e32eb798c36abd87b71863c4853e9a88eb889048..7e88bd37e86dd9008eef6f1c2409b1e68b9319c3 100644 (file)
@@ -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