MCPcopy Create free account
hub / github.com/Kitware/VTK / InsertRows

Method InsertRows

Common/DataModel/vtkTable.cxx:297–316  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

295
296//------------------------------------------------------------------------------
297void vtkTable::InsertRows(vtkIdType row, vtkIdType n)
298{
299 if (n <= 0)
300 {
301 return;
302 }
303
304 row = std::max<vtkIdType>(0, std::min<vtkIdType>(row, this->GetNumberOfRows()));
305
306 vtkIdType NRows = this->GetNumberOfRows();
307 vtkIdType newNRows = std::max<vtkIdType>(NRows, row) + n;
308
309 // enlarge the table
310 this->SetNumberOfRows(newNRows);
311
312 // move the existing elements backwards
313 vtkIdType first = row;
314 vtkIdType last = NRows - 1;
315 this->MoveRowData(first, last, n);
316}
317
318//------------------------------------------------------------------------------
319vtkIdType vtkTable::InsertNextBlankRow(double default_num_val)

Callers 3

InsertRowMethod · 0.95
onRowsInsertedMethod · 0.80
InsertRowsFunction · 0.80

Calls 3

GetNumberOfRowsMethod · 0.95
SetNumberOfRowsMethod · 0.95
MoveRowDataMethod · 0.95

Tested by 1

InsertRowsFunction · 0.64