| 1430 | } |
| 1431 | |
| 1432 | double vtkMultiBlockPLOT3DReader::GetTimeValue(const std::string& fname) |
| 1433 | { |
| 1434 | int rank = 0; |
| 1435 | // For now, only first rank does any reading. |
| 1436 | if (this->Controller) |
| 1437 | { |
| 1438 | rank = this->Controller->GetLocalProcessId(); |
| 1439 | } |
| 1440 | |
| 1441 | double time = vtkMath::Nan(); |
| 1442 | bool hasTime = false; |
| 1443 | int retval = 1; |
| 1444 | if (rank == 0) |
| 1445 | { |
| 1446 | try |
| 1447 | { |
| 1448 | if (this->XYZFileName && this->XYZFileName[0] != '\0' && |
| 1449 | (this->Internal->NeedToCheckXYZFile || this->Internal->Blocks.empty())) |
| 1450 | { |
| 1451 | vtkPlot3DCFile xyzFp; |
| 1452 | if (this->CheckGeometryFile(xyzFp) != VTK_OK) |
| 1453 | { |
| 1454 | throw Plot3DException(); |
| 1455 | } |
| 1456 | |
| 1457 | this->CalculateFileSize(xyzFp); |
| 1458 | |
| 1459 | if (!this->AutoDetectionCheck(xyzFp)) |
| 1460 | { |
| 1461 | throw Plot3DException(); |
| 1462 | } |
| 1463 | this->Internal->NeedToCheckXYZFile = false; |
| 1464 | } |
| 1465 | |
| 1466 | // We report time from the Q file for meta-type readers that |
| 1467 | // might support file series of Q files. |
| 1468 | if (!fname.empty()) |
| 1469 | { |
| 1470 | vtkPlot3DCFile qFp; |
| 1471 | if (this->CheckFile(qFp, fname.c_str()) != VTK_OK) |
| 1472 | { |
| 1473 | throw Plot3DException(); |
| 1474 | } |
| 1475 | int nq, nqc, overflow; |
| 1476 | if (this->ReadQHeader(qFp, false, nq, nqc, overflow) != VTK_OK) |
| 1477 | { |
| 1478 | throw Plot3DException(); |
| 1479 | } |
| 1480 | |
| 1481 | // I have seen Plot3D files with bogus time values so the only |
| 1482 | // type I have some confidence about having correct time values |
| 1483 | // is Overflow output. |
| 1484 | if (overflow) |
| 1485 | { |
| 1486 | vtkDataArray* properties = this->NewFloatArray(); |
| 1487 | |
| 1488 | this->SkipByteCount(qFp); |
| 1489 | properties->SetNumberOfTuples(4); |
no test coverage detected