MCPcopy Create free account
hub / github.com/Kitware/VTK / CharacterizeFile

Method CharacterizeFile

IO/Legacy/vtkDataReader.cxx:3521–3557  ·  view source on GitHub ↗

------------------------------------------------------------------------------ read entire file, storing important characteristics

Source from the content-addressed store, hash-verified

3519//------------------------------------------------------------------------------
3520// read entire file, storing important characteristics
3521int 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//------------------------------------------------------------------------------
3560void vtkDataReader::CheckFor(const char* name, char* line, int& num, char**& array, int& allocSize)

Callers 12

GetScalarsNameInFileMethod · 0.95
GetVectorsNameInFileMethod · 0.95
GetTensorsNameInFileMethod · 0.95
GetNormalsNameInFileMethod · 0.95
GetTCoordsNameInFileMethod · 0.95
GetNumberOfScalarsInFileFunction · 0.80
GetNumberOfVectorsInFileFunction · 0.80
GetNumberOfTensorsInFileFunction · 0.80
GetNumberOfNormalsInFileFunction · 0.80
GetNumberOfTCoordsInFileFunction · 0.80

Calls 7

OpenVTKFileMethod · 0.95
ReadHeaderMethod · 0.95
CloseVTKFileMethod · 0.95
ReadLineMethod · 0.95
CheckForMethod · 0.95
ModifiedMethod · 0.45

Tested by

no test coverage detected