------------------------------------------------------------------------------
| 454 | |
| 455 | //------------------------------------------------------------------------------ |
| 456 | void vtkBiomTableReader::InsertValue(int row, int col, const std::string& value) |
| 457 | { |
| 458 | std::stringstream stream; |
| 459 | stream << value; |
| 460 | |
| 461 | switch (this->DataType) |
| 462 | { |
| 463 | case VTK_INT: |
| 464 | int i; |
| 465 | if (!(stream >> i)) |
| 466 | { |
| 467 | vtkErrorMacro(<< "error converting '" << value << " to integer"); |
| 468 | } |
| 469 | else |
| 470 | { |
| 471 | vtkVariant v(i); |
| 472 | this->GetOutput()->SetValue(row, col, v); |
| 473 | } |
| 474 | break; |
| 475 | case VTK_FLOAT: |
| 476 | float f; |
| 477 | if (!(stream >> f)) |
| 478 | { |
| 479 | vtkErrorMacro(<< "error converting '" << value << " to float"); |
| 480 | } |
| 481 | else |
| 482 | { |
| 483 | vtkVariant v(f); |
| 484 | this->GetOutput()->SetValue(row, col, v); |
| 485 | } |
| 486 | break; |
| 487 | case VTK_STRING: |
| 488 | default: |
| 489 | vtkVariant v(value); |
| 490 | this->GetOutput()->SetValue(row, col, v); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | //------------------------------------------------------------------------------ |
| 495 | void vtkBiomTableReader::ParseColumns() |
no test coverage detected