------------------------------------------------------------------------------
| 295 | |
| 296 | //------------------------------------------------------------------------------ |
| 297 | void 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 | //------------------------------------------------------------------------------ |
| 319 | vtkIdType vtkTable::InsertNextBlankRow(double default_num_val) |