| 375 | } |
| 376 | |
| 377 | int vtkGenericDataObjectReader::ReadOutputType() |
| 378 | { |
| 379 | char line[256]; |
| 380 | |
| 381 | vtkDebugMacro(<< "Reading vtk data object..."); |
| 382 | |
| 383 | if (!this->OpenVTKFile() || !this->ReadHeader()) |
| 384 | { |
| 385 | return -1; |
| 386 | } |
| 387 | |
| 388 | // Determine dataset type |
| 389 | // |
| 390 | if (!this->ReadString(line)) |
| 391 | { |
| 392 | vtkDebugMacro(<< "Premature EOF reading dataset keyword"); |
| 393 | return -1; |
| 394 | } |
| 395 | |
| 396 | if (!strncmp(this->LowerCase(line), "dataset", static_cast<unsigned long>(7))) |
| 397 | { |
| 398 | // See iftype is recognized. |
| 399 | // |
| 400 | if (!this->ReadString(line)) |
| 401 | { |
| 402 | vtkDebugMacro(<< "Premature EOF reading type"); |
| 403 | this->CloseVTKFile(); |
| 404 | return -1; |
| 405 | } |
| 406 | |
| 407 | this->CloseVTKFile(); |
| 408 | |
| 409 | if (!strncmp(this->LowerCase(line), "cell_grid", 9)) |
| 410 | { |
| 411 | return VTK_CELL_GRID; |
| 412 | } |
| 413 | if (!strncmp(this->LowerCase(line), "molecule", 8)) |
| 414 | { |
| 415 | return VTK_MOLECULE; |
| 416 | } |
| 417 | if (!strncmp(this->LowerCase(line), "directed_graph", 14)) |
| 418 | { |
| 419 | return VTK_DIRECTED_GRAPH; |
| 420 | } |
| 421 | if (!strncmp(this->LowerCase(line), "undirected_graph", 16)) |
| 422 | { |
| 423 | return VTK_UNDIRECTED_GRAPH; |
| 424 | } |
| 425 | if (!strncmp(this->LowerCase(line), "polydata", 8)) |
| 426 | { |
| 427 | return VTK_POLY_DATA; |
| 428 | } |
| 429 | if (!strncmp(this->LowerCase(line), "rectilinear_grid", 16)) |
| 430 | { |
| 431 | return VTK_RECTILINEAR_GRID; |
| 432 | } |
| 433 | if (!strncmp(this->LowerCase(line), "statistical_model", 17)) |
| 434 | { |
no test coverage detected