------------------------------------------------------------------------------ read entire file, storing important characteristics
| 3519 | //------------------------------------------------------------------------------ |
| 3520 | // read entire file, storing important characteristics |
| 3521 | int vtkDataReader::CharacterizeFile() |
| 3522 | { |
| 3523 | if (this->CharacteristicsTime > this->MTime) |
| 3524 | { |
| 3525 | return 1; |
| 3526 | } |
| 3527 | |
| 3528 | this->InitializeCharacteristics(); |
| 3529 | this->CharacteristicsTime.Modified(); |
| 3530 | |
| 3531 | // Open the file |
| 3532 | if (!this->OpenVTKFile() || !this->ReadHeader()) |
| 3533 | { |
| 3534 | this->CloseVTKFile(); |
| 3535 | return 0; |
| 3536 | } |
| 3537 | |
| 3538 | char line[256]; |
| 3539 | while (this->ReadLine(line)) |
| 3540 | { |
| 3541 | this->CheckFor("scalars", line, this->NumberOfScalarsInFile, this->ScalarsNameInFile, |
| 3542 | this->ScalarsNameAllocSize); |
| 3543 | this->CheckFor("vectors", line, this->NumberOfVectorsInFile, this->VectorsNameInFile, |
| 3544 | this->VectorsNameAllocSize); |
| 3545 | this->CheckFor("tensors", line, this->NumberOfTensorsInFile, this->TensorsNameInFile, |
| 3546 | this->TensorsNameAllocSize); |
| 3547 | this->CheckFor("normals", line, this->NumberOfNormalsInFile, this->NormalsNameInFile, |
| 3548 | this->NormalsNameAllocSize); |
| 3549 | this->CheckFor("tcoords", line, this->NumberOfTCoordsInFile, this->TCoordsNameInFile, |
| 3550 | this->TCoordsNameAllocSize); |
| 3551 | this->CheckFor("field", line, this->NumberOfFieldDataInFile, this->FieldDataNameInFile, |
| 3552 | this->FieldDataNameAllocSize); |
| 3553 | } |
| 3554 | |
| 3555 | this->CloseVTKFile(); |
| 3556 | return 1; |
| 3557 | } |
| 3558 | |
| 3559 | //------------------------------------------------------------------------------ |
| 3560 | void vtkDataReader::CheckFor(const char* name, char* line, int& num, char**& array, int& allocSize) |
no test coverage detected